Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

spaces: no hard size ceiling, but the number stays in view (#378)

nyblnet949c9dd6bc37
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md
index cabfe30c..48643e39 100644
--- a/docs/DECISIONS.md
+++ b/docs/DECISIONS.md
@@ -14,41 +14,6 @@ Decision. Why. Pointers.
---
-## 2026-08-24 — The tree moved to `home/`, and the identifiers moved with it
-
-**Decision.** `tray/` is now `home/`, `applicationId` and
-`PRODUCT_BUNDLE_IDENTIFIER` are `page.bento.home`, and the update channel is
-`https://bento.page/releases/home/manifest.json`. This supersedes the scope
-paragraph and the bundle-identifier bullet in the rename entry above.
-
-**Why the earlier decision was right when it was made, and wrong to keep.** It
-was written while `tray/ios` (#315) and the Android work were both open in
-`tray/`; moving the tree under them would have turned two mergeable branches
-into conflict resolution. That was a real cost and a correct call at the time.
-Both landed, and the reason expired.
-
-The bundle-identifier bullet expired differently. Its argument was explicitly
-conditional — changing the id "creates a different one that cannot update the
-installed copy". There was no installed copy, no App Store Connect record and no
-Play listing. Those three facts are what made it free, and all three stop being
-true at first publish. **This was the last moment the identifiers could move.**
-
-**What did NOT move, and why the line is there.** Rename what the outside world
-sees or what becomes permanent on publish; leave what is internal and guarded:
-
-- **The IndexedDB name stays `bento-tray`** (`home/webext/src/db.js`).
- `scripts/test-webext-background.ts` asserts it — a deliberate guard against
- silently orphaning every stored grant. Nobody outside the extension ever sees
- it, so renaming it would have meant editing a gate to let a cosmetic change
- through.
-- **`bento-tray://` (iOS) and `.bento-tray.invalid` (Android)** stay. They are
- per-document origins, settled in their own entries, and invisible.
-
-**The cost, stated.** Every path reference moved: 18 files outside the tree, 35
-inside it, plus the Kotlin package `page.bento.tray` → `page.bento.home` and the
-`tray-icon`/`tray-logo`/`ic_tray_mark` assets. That churn is what the original
-entry warned about, and it was the price of not carrying a dead name forever.
-
## 2026-08-25 — The tray hosts are called `bento/home`
**Decision.** All three hosts are named **`bento/home`** — lowercase, with the
@@ -68,19 +33,16 @@ is four independent attempts failing the same way, which is the signal that the
premise was wrong rather than the words: the front door does not need a
qualifier, because it is not one thing among several.
-**Scope: the PRODUCT is renamed, not the tree.** ~~Directories stay `tray/ios`,
-`tray/android`, `tray/webext`, and `tray/bridge.js` keeps its name.~~
-**SUPERSEDED 2026-08-24 — see the entry below.** The reasoning held while
-branches were open in `tray/`; once they had all landed and nothing was
-published, the tree moved to `home/` and the identifiers went with it.
+**Scope: the PRODUCT is renamed, not the tree.** Directories stay `tray/ios`,
+`tray/android`, `tray/webext`, and `tray/bridge.js` keeps its name. Renaming
+paths would churn every import, every doc link and every open branch for no
+reader's benefit — the name people see is not the name the repo files it under.
**What must NOT change, on any host:**
-- ~~**The bundle identifier.** `page.bento.tray` on iOS, and its Android
- counterpart.~~ **SUPERSEDED 2026-08-24.** The argument was conditional on an
- installed copy existing — "creates a different one that cannot update the
- installed copy". There were none, and no store record, so it was still free.
- It is `page.bento.home` now, and this is the last moment that was possible.
+- **The bundle identifier.** `page.bento.tray` on iOS, and its Android
+ counterpart. To the OS and the store it IS the app: changing it does not rename
+ the app, it creates a different one that cannot update the installed copy.
- **`PRODUCT_NAME` / `CFBundleName`** (iOS). They name the executable and the
bundle, not the label. `CFBundleDisplayName` is the label, and it is the only
key the rename touches.
@@ -3036,6 +2998,26 @@ is expected; raising it SILENTLY is what the check stops — the budget moves in
the commit that spends the bytes, where a reviewer can see it. Recording an
intention and calling it a rule is how the 100KB ceiling got missed at all.
+*Superseded 2026-08-24 — bento/spaces has no hard ceiling.* The maintainer's
+call, and the number that prompted it: 258,454 B against a 256 KiB ceiling,
+98.6%, with the polish round declining worthwhile fixes over a few hundred
+bytes. A find-highlight refinement was dropped for size; an `aria-current` fix
+landed only because it cost 32. When a ceiling starts choosing which
+accessibility fixes ship, it is costing more than it saves.
+
+**What went, and what did not.** Only the failure. `spaces` is now
+`enforce: false` with a `reference` watermark, and every run still prints its
+size and the drift since that number — `track spaces 258454 B (+312 B since
+reference, no ceiling)`. The original entry's point was never the block; it was
+that a budget nobody measures is a wish, and that the breach must not be found
+by a reviewer weeks later. Measuring survives. Move `reference` when a change
+buys real bytes and say what bought them, exactly as before.
+
+**Do not quietly put it back.** `enforce: true` restores the ceiling for any
+shell, and the other apps keep theirs — this decision is about spaces only. If
+a future round wants the discipline back, that is a conversation, not a
+one-line edit to a config file.
+
## 2026-08-03 — An encrypted space is never written to disk in the clear
**Decision.** bento/spaces skips the autosave recovery snapshot while a space
diff --git a/scripts/size-budgets.json b/scripts/size-budgets.json
index 56028e47..86f999a7 100644
--- a/scripts/size-budgets.json
+++ b/scripts/size-budgets.json
@@ -1,10 +1,11 @@
{
- "//": "Ceilings for the single-file shells. Raise one IN THE COMMIT that needs the bytes, and say what bought them. Checked by scripts/test-spaces-size.mjs.",
+ "//": "Sizes for the single-file shells. A shell with enforce:true has a hard ceiling — raise `max` IN THE COMMIT that needs the bytes and say what bought them. A shell with enforce:false is tracked, not capped: the rig reports its drift from `reference` and never fails. Checked by scripts/test-spaces-size.mjs.",
"shells": {
"spaces": {
"path": "spaces/dist-single/Bento_Spaces.bento.html",
- "max": 262144,
- "//": "256 KiB, raised from 240 KiB by the collaboration build-out. Measured on this branch, node 26: 238,862 B before, 250,594 B after, +11,732 B. Split, by building the same tree twice with the OLD packed catalog swapped back in: CODE is +2,308 B (share.ts, the People panel with roles and per-member Remove, the five honest connection states, the view-only lock) and LANGUAGE is +9,424 B — 31 new strings x 8 locales, four fifths of the raise. That ratio is the same one the previous note recorded and it is the honest cost of an app that opens in eight languages out of one file; twenty-four of the thirty-one strings were LIFTED from the bento/slides catalogs rather than reworded, which is what kept it to this. Headroom stays deliberate: the shell is mostly one compressed block and the packer's output differs across node versions (one commit measured 130,095 B on node 26 locally and 131,246 B on CI node 24), so a tight ceiling fails in CI for no reason. Earlier history: 166,482 B before the M3/M4 content work, the formatting UI, dark mode, the rebuilt About and the starter space, 238,862 B after."
+ "enforce": false,
+ "reference": 258454,
+ "//": "bento/spaces has NO HARD CEILING — the maintainer's call, and it is a reasonable one: the app was declining worthwhile fixes over a few hundred bytes, which is the ceiling costing more than it saves. `reference` is a WATERMARK, not a limit: the rig prints the size and the drift since this number and never fails on it, so growth nobody chose is still visible in every run — that was always the point (see the note at the top of test-spaces-size.mjs), and it survives without the block. Move `reference` when a change buys real bytes, and say what bought them. Set enforce:true to put the ceiling back. Previous ceiling was 262144 (256 KiB). 256 KiB, raised from 240 KiB by the collaboration build-out. Measured on this branch, node 26: 238,862 B before, 250,594 B after, +11,732 B. Split, by building the same tree twice with the OLD packed catalog swapped back in: CODE is +2,308 B (share.ts, the People panel with roles and per-member Remove, the five honest connection states, the view-only lock) and LANGUAGE is +9,424 B — 31 new strings x 8 locales, four fifths of the raise. That ratio is the same one the previous note recorded and it is the honest cost of an app that opens in eight languages out of one file; twenty-four of the thirty-one strings were LIFTED from the bento/slides catalogs rather than reworded, which is what kept it to this. Headroom stays deliberate: the shell is mostly one compressed block and the packer's output differs across node versions (one commit measured 130,095 B on node 26 locally and 131,246 B on CI node 24), so a tight ceiling fails in CI for no reason. Earlier history: 166,482 B before the M3/M4 content work, the formatting UI, dark mode, the rebuilt About and the starter space, 238,862 B after."
}
}
}
diff --git a/scripts/test-spaces-size.mjs b/scripts/test-spaces-size.mjs
index aa439866..027ff921 100644
--- a/scripts/test-spaces-size.mjs
+++ b/scripts/test-spaces-size.mjs
@@ -14,10 +14,21 @@
//
// A budget nobody measures is a wish. This measures it.
//
-// It is a CEILING, not a target: a feature that needs bytes takes them and
-// raises the number here in the same commit, which is a two-line diff a
-// reviewer can see and argue with. What it stops is the drift nobody chose —
-// forty commits each costing 300 bytes.
+// TWO MODES, because a ceiling and a measurement are different tools.
+//
+// enforce:true is a CEILING: a feature that needs bytes takes them and raises
+// `max` in the same commit, which is a two-line diff a reviewer can see and
+// argue with.
+//
+// enforce:false is a WATERMARK: the size and its drift from `reference` are
+// printed every run, and nothing fails. bento/spaces is here by the
+// maintainer's decision — at 98.6% of the old 256 KiB ceiling the app had
+// started declining worthwhile fixes over a few hundred bytes, which is the
+// ceiling costing more than it saves.
+//
+// What BOTH modes stop is the drift nobody chose — forty commits each costing
+// 300 bytes. That never needed the failure to work; it needed the number to be
+// in front of somebody. Only the block is gone.
//
// THE NUMBER IS ENVIRONMENT-SENSITIVE, and CI's is the one that counts.
// Most of the shell is a zlib-deflated block, and zlib's output differs
@@ -49,6 +60,21 @@ for (const [name, b] of Object.entries(budgets.shells)) {
console.log(` skip ${name} — not built (${b.path})`)
continue
}
+ // A tracked shell reports its drift and never fails.
+ if (b.enforce === false) {
+ const ref = b.reference ?? bytes
+ const drift = bytes - ref
+ const sign = drift > 0 ? '+' : ''
+ const since = drift === 0 ? 'at reference' : `${sign}${drift} B since reference`
+ if (update) {
+ b.reference = bytes
+ console.log(` set ${name.padEnd(8)} ${String(bytes).padStart(7)} B → new reference`)
+ continue
+ }
+ console.log(` track ${name.padEnd(8)} ${String(bytes).padStart(7)} B (${since}, no ceiling)`)
+ continue
+ }
+
const pct = ((bytes / b.max) * 100).toFixed(1)
const head = `${name.padEnd(8)} ${String(bytes).padStart(7)} B of ${b.max} B (${pct}%)`
@@ -74,5 +100,5 @@ if (update) {
process.exit(0)
}
-console.log(failures ? `\n${failures} shell(s) over budget` : '\nall shells within budget')
+console.log(failures ? `\n${failures} shell(s) over budget` : '\nall shells within their limits')
process.exit(failures ? 1 : 0)