dsh-hashline-edit 0.5.4 → 0.5.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/README.md +19 -13
- package/lib/client.js +8 -3
- package/lib/index.js +208 -86
- package/lib/types/dsh/index.d.ts +3 -0
- package/lib/types/src/file-content/preview.d.ts +1 -1
- package/lib/types/src/hashline/anchor-codebook.d.ts +15 -0
- package/lib/types/src/hashline/apply.d.ts +1 -1
- package/lib/types/src/hashline/gutter.d.ts +13 -0
- package/lib/types/src/hashline/hash-identity.d.ts +8 -5
- package/lib/types/src/hashline/row-mode.d.ts +17 -0
- package/lib/types/src/served-session/serve-render.d.ts +6 -0
- package/lib/types/src/store-kernel/constants.d.ts +1 -1
- package/package.json +1 -1
- package/prompts/apply-patch-guidelines.md +2 -2
- package/prompts/codegraph-guidelines.md +2 -2
- package/prompts/diagnostics-guidelines.md +1 -1
- package/prompts/edit-guidelines.md +2 -2
- package/prompts/read-description.md +1 -1
- package/prompts/read-guidelines.md +3 -3
- package/prompts/rg-guidelines.md +2 -2
- package/prompts/write-guidelines.md +2 -2
- package/src/file-content/preview.ts +23 -13
- package/src/hash-store.ts +46 -1
- package/src/hashline/anchor-codebook.ts +19 -0
- package/src/hashline/apply.ts +10 -4
- package/src/hashline/gutter.ts +35 -0
- package/src/hashline/hash-identity.ts +61 -19
- package/src/hashline/parse.ts +3 -2
- package/src/hashline/resolve.ts +7 -5
- package/src/hashline/row-mode.ts +43 -0
- package/src/prompts.ts +3 -1
- package/src/served-session/serve-render.ts +18 -1
- package/src/snapshot-store/vacuum.ts +6 -0
- package/src/store-kernel/constants.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# diagnostics guidelines
|
|
2
2
|
|
|
3
3
|
- Prefer `diagnostics` over re-reading a build log: one call turns a compiler's or linter's errors and warnings into anchored rows for the files it names.
|
|
4
|
-
- Every block is served as `HASH│content` rows and is therefore already read: fix the file with those anchors instead of reading it again.
|
|
4
|
+
- Every block is served as `HASH│content` rows (each prefixed by a display-only line-number gutter) and is therefore already read: fix the file with those anchors instead of reading it again.
|
|
5
5
|
- The row a diagnostic points at is named in the header above its block (`— path:line:col`); the rows stay byte-identical to a `read` page, so the marker never appears inside them.
|
|
6
6
|
- `tool` picks the toolchain: `cargo-check` and `cargo-clippy` for Rust, `tsc` for TypeScript. Run it from — or pass `cwd` as — the directory the toolchain expects: the cargo workspace root, or the one holding `tsconfig.json`.
|
|
7
7
|
- Narrow the report with `maxDiagnostics` and widen each snippet with `contextLines` (1-10) rather than reading a whole file around one error.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
- edit: one call targets one `file` in one transaction — batch all N changes to that file as N items in the same call, and use parallel `edit` calls for different target files.
|
|
2
2
|
- edit: every item carries exactly one payload — `text` (literal content; `""` deletes the range when `at` is `"in-place"`, and is a no-op for `"before"`/`"after"`), `text_ref` (with required non-null `mode`: `"copy"` re-inserts the served span's bytes, `"cut"` also deletes the source lines), or one of the insertion slots `after`/`before` (the lines to place immediately below/above `anchor_from`); never two, never none.
|
|
3
3
|
- edit: when `text_ref` uses `mode: "cut"` (same file or another served file via `text_ref.file`), the source lines are deleted automatically in the same correlated transaction — never send a second `edit` to delete the source span.
|
|
4
|
-
- edit: anchors are strictly the
|
|
4
|
+
- edit: anchors are strictly the `{{HASH_LEN}}` characters immediately left of `│` in served rows — the segment between the display-only line-number gutter (`12{{GUTTER}}`) and `│`, never the gutter, a line number, the full row, or null. `anchor_from` is always required and names the first line of the range; `anchor_to` is optional and names the last line — omit it to edit the single line `anchor_from` names (the range is single-line without it, which is mandatory when `at` is `"before"` or `"after"`), and a `text_ref` span always names both bounds.
|
|
5
5
|
- edit: change only what the task changes — one item per intended range, keeping unchanged boundary rows and `HASH│` prefixes out of `text`.
|
|
6
6
|
- edit: a stale or unknown anchor, or an overlapping range, rejects the whole call and writes nothing. A `text` payload echoing served rows in default top-level `mode: "general"` is refused (`E_SUSPICIOUS_TEXT`); prefer `text_ref` to duplicate or move served spans, or set top-level `mode: "literal"` when `text` must intentionally reproduce served lines.
|
|
7
7
|
- edit: anchors already in context (from `read`, an auto-read, or an intercepted shell view that output `HASH│content` rows) need no re-read; an anchor rejection serves the current `HASH│content` rows back, so repair directly from those rows instead of re-reading or guessing.
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
- edit: `indent: "auto"` (optional; default `"as-is"`) writes a flush-left or uniformly indented `text`/`after`/`before` payload at the depth of the `anchor_from` line — the tool strips the payload's shared leading-whitespace prefix and keeps tabs, spaces and blank lines as written. `text_ref` refuses `indent` (copied bytes are verbatim). The result's notes report the lines it moved.
|
|
10
10
|
- edit: `expand: "item"` (optional) replaces the whole syntax item containing `anchor_from` — its leading doc comment/attributes and its closing brace included — so name only `anchor_from` and send a `text` payload; `anchor_to`, `text_ref`, `after`/`before` and a non-in-place `at` are refused. Prefer it over a hand-written multi-line range when the intent is "replace this function/class/method": you do not reproduce the doc comment or the closing brace, and the diff shows the whole replaced node. It needs a shipped code grammar (rust, typescript, tsx, vue, python, go, java); a non-code file, an unavailable grammar, or an anchor outside any item refuses (`E_EXPAND_UNAVAILABLE`) and writes nothing. One expanded item per call.
|
|
11
11
|
- edit: a successful call that turns a clean file into one with parse errors appends a `[W_SYNTAX]` warning naming the damaged line; the write already landed, so re-read around that line and correct the range instead of repeating the call.
|
|
12
|
-
- edit: `write` is the whole-file path — use `write` to create a new file or replace every line, never `edit`.
|
|
12
|
+
- edit: `write` is the whole-file path — use `write` to create a new file or replace every line, never `edit`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Read a UTF-8 text file as hash-anchored
|
|
1
|
+
Read a UTF-8 text file as hash-anchored served rows. Each served row is a display-only line-number gutter, then the anchor, the `│` separator, and the content — `12{{GUTTER}}HASH│content` by default (arrow, U+2192) or `12: HASH│content` in the opt-in native gutter. The anchor is the `{{HASH_LEN}}` characters immediately left of `│` (the segment between the number gutter and `│`); the line-number gutter is display-only, never part of the anchor, never addressable. Served mode is the default; `mode: "verbatim"` returns plain text as `12{{GUTTER}}content` (arrow) or `12: content` (native) with no anchors and no line-budget cap (and does not register anchors for `edit`); `mode: "folded"` returns the file's structural skeleton — a single-line item as `12{{GUTTER}}HASH│opening`, a range as `12..30{{GUTTER}}HASH1..HASH2│opening`, a gap run as `12..30{{GUTTER}}HASH1..HASH2│… (N lines) …`, one row per syntax item — and always covers the whole file, so it refuses `offset`/`limit`/`windows`. Supports `offset`/`limit` paging and `windows` to batch up to 16 disjoint ranges (`offset`/`limit`, or `around_anchor` + `radius` for an anchor already served in this session) in one call. Image, binary, and directory paths are refused (`E_UNSUPPORTED_FILE`).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
- read: call it only for spans not yet served as `HASH│content` rows in this session; an intercepted shell view (`cat`, `rg`, `Get-Content`, `Select-String`, etc.) or write-hook auto-read that output `HASH│content` rows already served the file for `edit`, whereas raw unanchored stdout is not served.
|
|
1
|
+
- read: call it only for spans not yet served as `HASH│content` rows (each prefixed by a display-only line-number gutter, `12{{GUTTER}}`) in this session; an intercepted shell view (`cat`, `rg`, `Get-Content`, `Select-String`, etc.) or write-hook auto-read that output `HASH│content` rows already served the file for `edit`, whereas raw unanchored stdout is not served.
|
|
2
2
|
- read: batch up to 16 disjoint ranges of a file in ONE call with `windows` — each using `offset`/`limit`, or `around_anchor` plus `radius` around an anchor already served in this session (unserved anchors are omitted with a warning). Read multiple files with parallel `read` calls, one file per call.
|
|
3
3
|
- read: keep requested windows compact (61 lines or fewer) — the tool automatically widens compact windows to their enclosing syntax block (capped at 80 lines for code/Markdown and 40 for plain text, noted `[widened …]`), so do not manually pad `offset`/`limit` margins. Single-page output is also bounded by a byte budget.
|
|
4
4
|
- read: omit `mode` for any file you might later edit (code, configs, READMEs) so rows carry anchors; pass `mode: "verbatim"` only for strictly read-only reference files (e.g., skill files), as `verbatim` is uncapped and records no anchors for `edit`.
|
|
5
5
|
- read: `read` accepts UTF-8 text files only — images, binary files, and directories are refused (`E_UNSUPPORTED_FILE`).
|
|
6
|
-
- read: pass `mode: "folded"` to survey a large source file as its structural skeleton — one row per syntax item carrying that item's first and last anchors (`
|
|
7
|
-
- read: a folded range row is a whole-item target — copy its two anchors into `anchor_from` and `anchor_to` to replace or delete the item. A `… (N lines) …` row is a run the page did not show: its first..last anchors are served but its lines are not, so read that range with `offset`/`limit` before editing inside it.
|
|
6
|
+
- read: pass `mode: "folded"` to survey a large source file as its structural skeleton — one row per syntax item carrying that item's first and last anchors, each row prefixed by a display-only line-number gutter (`12{{GUTTER}}HASH│opening line` for a single-line item, `12..30{{GUTTER}}HASH1..HASH2│opening line` for a range), with `foldDepth` 1-3 (default 1) revealing nested members. A folded read always covers the whole file and refuses `offset`/`limit`/`windows`.
|
|
7
|
+
- read: a folded range row is a whole-item target — copy its two anchors into `anchor_from` and `anchor_to` to replace or delete the item (the anchors are the `{{HASH_LEN}}` characters immediately left of `│`; the `12..30{{GUTTER}}` gutter is display-only). A `… (N lines) …` row is a run the page did not show: its first..last anchors are served but its lines are not, so read that range with `offset`/`limit` before editing inside it.
|
package/prompts/rg-guidelines.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# rg guidelines
|
|
2
2
|
|
|
3
3
|
- `rg` is the file-content search tool: call it instead of a shell `grep`/`rg` command, and instead of the built-in `grep`, which this profile hides while `rg` is on.
|
|
4
|
-
- Prefer one `rg` call over a search-then-read loop: with `read` on, every matched line comes back served and leased — as `HASH│content` on a direct call's page, and as each match's `hash` (the anchor of that same served row) inside `run_code` — so `edit`/`apply_patch` can target those anchors with no separate `read`.
|
|
4
|
+
- Prefer one `rg` call over a search-then-read loop: with `read` on, every matched line comes back served and leased — as `HASH│content` rows (each prefixed by a display-only line-number gutter, `12{{GUTTER}}`) on a direct call's page, and as each match's `hash` (the anchor of that same served row) inside `run_code` — so `edit`/`apply_patch` can target those anchors with no separate `read`.
|
|
5
5
|
- The default is ripgrep's smart case (insensitive only when the pattern has no uppercase); pass `ignoreCase` to force `-i`, `fixedStrings` for literal text, `wordMatch` for whole words.
|
|
6
6
|
- `hidden` adds dotfiles and directories, `noIgnore` drops `.gitignore`/`.ignore` filtering: use them to reach a file the default search skipped, not by default.
|
|
7
7
|
- Narrow instead of enlarging: `include` takes ONE positive glob (`*.ts`, `*.{js,jsx}`) and `path` scopes the search to a file or directory. Past 250 matches the result is reported as a count and passes through unserved.
|
|
8
|
-
- A result that reports no `rg` on PATH, a pattern ripgrep rejected or the time budget is guidance, not a failure: fix `rgPath`, simplify the pattern, or narrow the path rather than repeating the call.
|
|
8
|
+
- A result that reports no `rg` on PATH, a pattern ripgrep rejected or the time budget is guidance, not a failure: fix `rgPath`, simplify the pattern, or narrow the path rather than repeating the call.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
- write: read the file before overwriting it; `write` replaces the whole file, so use it for a new file or a rewrite where every line changes.
|
|
2
2
|
- write: a partial change is not a whole-file rewrite even when the whole file is already in context — use `edit` on the served rows instead.
|
|
3
|
-
- write: never paste served `HASH
|
|
4
|
-
- write: the result is the native one-line success — no anchors come back with it (the opt-in `writeAutoRead` switch restores an appended anchored page). `read` the file when a follow-up `edit` needs anchors.
|
|
3
|
+
- write: never paste served rows — a display-only line-number gutter (`12{{GUTTER}}`) then `HASH│content` — into the content; a line that reproduces a served row is refused as a served hash echo.
|
|
4
|
+
- write: the result is the native one-line success — no anchors come back with it (the opt-in `writeAutoRead` switch restores an appended anchored page). `read` the file when a follow-up `edit` needs anchors.
|
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
import { fmtRegion } from "../hashline/apply.js";
|
|
18
18
|
import { loadHashStore } from "../hash-store.js";
|
|
19
19
|
import { snapshotIOFor } from "../snapshot-store";
|
|
20
|
-
import type
|
|
20
|
+
import { type ServedRow, formatServedRow } from "../served-session/serve-render.js";
|
|
21
|
+
import { lineGutter } from "../hashline/gutter.js";
|
|
21
22
|
import { formatSectionHeader } from "./served-header.js";
|
|
22
23
|
import { mergeRanges, visibleLineTotal, walkLines, type LineRange } from "./line-walker.js";
|
|
23
24
|
|
|
@@ -80,11 +81,16 @@ function normWindows(windows: ReadWindow[] | undefined): ReadWindow[] | undefine
|
|
|
80
81
|
|
|
81
82
|
// WHY: verbatim renders the identical admitted rows with no anchor prefix; the row set and budgets
|
|
82
83
|
// WHY: are computed once, so only this formatter differs between the two modes.
|
|
83
|
-
function fmtRows(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
function fmtRows(
|
|
85
|
+
hashes: readonly string[],
|
|
86
|
+
lines: readonly string[],
|
|
87
|
+
verbatim: boolean,
|
|
88
|
+
startLine: number,
|
|
89
|
+
): string {
|
|
90
|
+
if (!verbatim) return fmtRegion(startLine, hashes, lines);
|
|
91
|
+
if (lines.length === 0) return "";
|
|
92
|
+
// WHY: the `N: ` gutter already distinguishes a lone empty line from an empty result.
|
|
93
|
+
return lines.map((line, index) => `${lineGutter(startLine + index)}${line}`).join("\n");
|
|
88
94
|
}
|
|
89
95
|
|
|
90
96
|
function emptyFilePreview(
|
|
@@ -102,7 +108,7 @@ function emptyFilePreview(
|
|
|
102
108
|
throw new Error("empty file preview is missing its walk anchor");
|
|
103
109
|
}
|
|
104
110
|
return {
|
|
105
|
-
text: `${emptyLineHash}
|
|
111
|
+
text: `${formatServedRow(1, emptyLineHash, "")}\n[File is empty. Use edit to insert content.]`,
|
|
106
112
|
served: [{ position: 0, hash: emptyLineHash }],
|
|
107
113
|
};
|
|
108
114
|
}
|
|
@@ -163,7 +169,7 @@ function buildOversizedPreview(params: {
|
|
|
163
169
|
if (hash === undefined || line === undefined) {
|
|
164
170
|
throw new Error(`preview row ${index} has no selected line`);
|
|
165
171
|
}
|
|
166
|
-
return fmtRows([hash], [line], verbatim);
|
|
172
|
+
return fmtRows([hash], [line], verbatim, startLine + index);
|
|
167
173
|
});
|
|
168
174
|
const skippedTruncation = truncateHead(rows.join("\n"), { maxBytes, maxLines: maxTruncLines });
|
|
169
175
|
const shownRowCount =
|
|
@@ -295,7 +301,7 @@ function buildWindowSection(params: {
|
|
|
295
301
|
});
|
|
296
302
|
}
|
|
297
303
|
const normal = buildNormalPreview({
|
|
298
|
-
formatted: fmtRows(selectedHashes, selected, verbatim),
|
|
304
|
+
formatted: fmtRows(selectedHashes, selected, verbatim, startLine),
|
|
299
305
|
startLine,
|
|
300
306
|
endIdx,
|
|
301
307
|
totalLines,
|
|
@@ -431,7 +437,7 @@ function buildWindowedPreview(params: {
|
|
|
431
437
|
);
|
|
432
438
|
// WHY: `metrics.truncated` must be honest when the shared budget cut a window away, so the
|
|
433
439
|
// WHY: same function that reports truncation elsewhere derives it from the budget actually spent.
|
|
434
|
-
const skipped = truncateHead(fmtRows(selectedHashes, selected, verbatim), {
|
|
440
|
+
const skipped = truncateHead(fmtRows(selectedHashes, selected, verbatim, window.offset), {
|
|
435
441
|
maxBytes: Math.max(0, remainingBytes),
|
|
436
442
|
maxLines: Math.max(0, remainingLines),
|
|
437
443
|
});
|
|
@@ -441,7 +447,9 @@ function buildWindowedPreview(params: {
|
|
|
441
447
|
const rowSizes = selected.map((line, index) => ({
|
|
442
448
|
lineNumber: window.offset + index,
|
|
443
449
|
bytes: Buffer.byteLength(
|
|
444
|
-
verbatim
|
|
450
|
+
verbatim
|
|
451
|
+
? `${lineGutter(window.offset + index)}${line}`
|
|
452
|
+
: formatServedRow(window.offset + index, selectedHashes[index] ?? "", line),
|
|
445
453
|
"utf-8",
|
|
446
454
|
),
|
|
447
455
|
}));
|
|
@@ -738,12 +746,14 @@ export async function fmtReadPreview(
|
|
|
738
746
|
// WHY: a ranged source is already page-aligned (its array starts at `startLine`), while a full anchor
|
|
739
747
|
// WHY: array is indexed by absolute line — slice only the latter (ADR-0043).
|
|
740
748
|
const selectedHashes = ranged !== undefined ? allHashes : allHashes.slice(startLine - 1, endIdx);
|
|
741
|
-
const formatted = fmtRows(selectedHashes, selected, verbatim);
|
|
749
|
+
const formatted = fmtRows(selectedHashes, selected, verbatim, startLine);
|
|
742
750
|
const maxBytes = maxLineBytes;
|
|
743
751
|
const rowSizes = selected.map((line, index) => ({
|
|
744
752
|
lineNumber: startLine + index,
|
|
745
753
|
bytes: Buffer.byteLength(
|
|
746
|
-
verbatim
|
|
754
|
+
verbatim
|
|
755
|
+
? `${lineGutter(startLine + index)}${line}`
|
|
756
|
+
: formatServedRow(startLine + index, selectedHashes[index] ?? "", line),
|
|
747
757
|
"utf-8",
|
|
748
758
|
),
|
|
749
759
|
}));
|
package/src/hash-store.ts
CHANGED
|
@@ -544,7 +544,12 @@ export function ensureSnapshotTables(db: DatabaseSync): void {
|
|
|
544
544
|
if (hasLeases) {
|
|
545
545
|
db.exec(`DELETE FROM served_leases WHERE ${FOREIGN_GENERATION_LEASE_SQL}`);
|
|
546
546
|
}
|
|
547
|
-
db.exec(
|
|
547
|
+
db.exec(
|
|
548
|
+
`DELETE FROM file_snapshots WHERE ${FOREIGN_GENERATION_SNAPSHOT_SQL}`,
|
|
549
|
+
);
|
|
550
|
+
if (hasTable("file_undo") && readTableColumns(db, "file_undo").has("anchor_generation")) {
|
|
551
|
+
db.exec(`DELETE FROM file_undo WHERE anchor_generation NOT IN (0, ${ANCHOR_GENERATION})`);
|
|
552
|
+
}
|
|
548
553
|
db.exec(`DELETE FROM line_lineage WHERE ${ORPHAN_LINEAGE_SQL}`);
|
|
549
554
|
// WHY: one provenance rule as of this sweep — a lease that names no surviving
|
|
550
555
|
// WHY: snapshot for its own path is dangling (same-generation pre-column rows read
|
|
@@ -651,6 +656,45 @@ export function ensureFileUndoSchema(db: DatabaseSync): void {
|
|
|
651
656
|
addColumnIfMissing(db, "cut_intent", "direction");
|
|
652
657
|
}
|
|
653
658
|
|
|
659
|
+
/**
|
|
660
|
+
* WHY: deleted rows leave free pages SQLite never returns to the OS without a VACUUM, so a large
|
|
661
|
+
* generation/schema migration (or months of TTL pruning) can leave the file tens of times its live
|
|
662
|
+
* size — the 1.16GB-for-100MB case that made every open of a big store crawl. After the slow-path
|
|
663
|
+
* sweep we checkpoint the WAL and, when free pages dominate, switch to incremental auto-vacuum and
|
|
664
|
+
* VACUUM once; later TTL deletes are then reclaimed cheaply by `PRAGMA incremental_vacuum`.
|
|
665
|
+
*/
|
|
666
|
+
function reclaimStoreSpace(db: DatabaseSync): void {
|
|
667
|
+
try {
|
|
668
|
+
db.exec("PRAGMA wal_checkpoint(TRUNCATE)");
|
|
669
|
+
} catch {
|
|
670
|
+
// best-effort: a held reader only defers the truncate
|
|
671
|
+
}
|
|
672
|
+
try {
|
|
673
|
+
const total = Number((db.prepare("PRAGMA page_count").get() as { page_count?: number }).page_count ?? 0);
|
|
674
|
+
const free = Number((db.prepare("PRAGMA freelist_count").get() as { freelist_count?: number }).freelist_count ?? 0);
|
|
675
|
+
if (total > 0 && free > 2048 && free / total > 0.2) {
|
|
676
|
+
try {
|
|
677
|
+
db.exec("PRAGMA auto_vacuum = INCREMENTAL");
|
|
678
|
+
} catch {
|
|
679
|
+
// pre-existing auto_vacuum cannot always be changed; the standalone VACUUM below still reclaims
|
|
680
|
+
}
|
|
681
|
+
db.exec("VACUUM");
|
|
682
|
+
try {
|
|
683
|
+
db.exec("PRAGMA wal_checkpoint(TRUNCATE)");
|
|
684
|
+
} catch {
|
|
685
|
+
// best-effort
|
|
686
|
+
}
|
|
687
|
+
} else {
|
|
688
|
+
try {
|
|
689
|
+
db.exec("PRAGMA incremental_vacuum");
|
|
690
|
+
} catch {
|
|
691
|
+
// best-effort
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
} catch {
|
|
695
|
+
// best-effort: space reclamation must never fail an otherwise-good open
|
|
696
|
+
}
|
|
697
|
+
}
|
|
654
698
|
function buildStore(db: DatabaseSync): boolean {
|
|
655
699
|
// WHY: the open's stamp-due decision is made ONCE here and handed back through `openDb`: it gates the
|
|
656
700
|
// WHY: sweep below and the `version` upsert at the end, and it is what `openStore` owes a stamp write
|
|
@@ -772,6 +816,7 @@ function buildStore(db: DatabaseSync): boolean {
|
|
|
772
816
|
// WHY: its value is a build constant, so it belongs to the build. The halves that certify the WHOLE
|
|
773
817
|
// WHY: open are owed to `openStore` instead: written here they would certify hook work that has not run.
|
|
774
818
|
if (!stampDue) return false;
|
|
819
|
+
reclaimStoreSpace(db);
|
|
775
820
|
db.prepare(
|
|
776
821
|
"INSERT INTO meta (key, value) VALUES ('version', ?) " +
|
|
777
822
|
"ON CONFLICT(key) DO UPDATE SET value = excluded.value",
|