Skip to content

feat(maintenance): typed-target confirmation, a per-row preview and the engine principal - #1246

Merged
cevheri merged 25 commits into
mainfrom
feat/maintenance-preview
Oct 3, 2026
Merged

cevheri merged 25 commits into
mainfrom
feat/maintenance-preview

Conversation

@cevheri

@cevheri cevheri commented Oct 3, 2026

Copy link
Copy Markdown
Member

Lets a provider declare per-row maintenance that asks for more than a confirm click, and record who ran it on the engine.
No shipped provider declares either new form, so every engine's Operations, Tables, tree and mobile controls are unchanged; tests/unit/db/maintenance-surface-census.test.ts pins each shipped provider's per-row controls.

  • MaintenanceOperationSpec.confirmation gains "typed-target": the admin types the target's name to confirm. It is accepted only on a per-row control (perEntity: true, global: false), so a whole-database card can never run on one click.
  • An optional MaintenanceOperationSpec.preview and the published MaintenancePreview: a read-only per-row preview the dialog shows first, with its facts and an optional refusal that offers no confirm button. It is served by POST /api/db/maintenance/preview, admin-only, under the same rate-limit bucket and request checks as the maintenance route, and it calls only the provider's previewMaintenance.
  • The optional DatabaseProvider methods previewMaintenance and engineUser; the maintenance route writes the engine principal as engine_user on every audit row, never a secret.

Published type changes, for the release note: MaintenanceOperationSpec.confirmation widened, MaintenanceOperationSpec.preview, MaintenancePreview (from src/exports/types.ts), and previewMaintenance and engineUser on DatabaseProvider.

@cevheri
cevheri force-pushed the feat/maintenance-preview branch from c213435 to e8475d0 Compare October 3, 2026 12:22
@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

cevheri added 25 commits October 3, 2026 16:11
The table and its count missed the two account-administration routes,
and the preview route was added on top of that stale base. Seven
handler sites call auditRoleDenial, plus the proxy; a unit test now
derives the set from src/app and holds the table and the numerals to it.

Fixes review findings SC-1 and R1.
The preview route served a preview for a spec declaring preview: true
with both placements false, which no surface draws. It now answers the
no-preview 400 unless the per-row placement is offered, and the
capability test holds every shipped spec that declares a preview to
perEntity: true and a provider that implements previewMaintenance.

Fixes review finding B1.
Facts were keyed by label alone, and a preview that names each vector
field under one label logged a duplicate-key warning. Each fact is now
keyed by its label and how many facts before it share that label.

Fixes review finding B2.
Both maintenance routes destructured the parsed body directly, so null
answered 500 with the raw TypeError message and text that is not JSON
answered 500 as well. A body that is not a JSON object now answers 400
"Invalid request body" before any provider is opened, on the existing
route and on the preview route that copies its checks.

Fixes review finding B3.
The comment said seventeen direct call sites while its own grep already
answered twenty-one on main, and the preview route made it twenty-two.
It now names all twenty-two files, the two that hold two call sites
each, and the thirty-two route files in total.

Fixes review findings B4 and R2.
The docblock described a tarball type check as if the repository ran
it. It was a one-off pre-merge measurement in a gitignored folder, so
the docblock now says what this file covers and what it does not.

Addresses review findings SC-2 and R3; a tracked tarball check in CI
is deferred.
Split two sentences that shared a line, and call the engine_user rows
completed, failed (success: false) and thrown, since "refused" read as
the route's own 400 refusals, which write no maintenance row.

Fixes review findings R4 and R5.
The new route test copied the five-key auth stub that BACKLOG D85 records as debt, which also missed two of
the module's seven exports. It now spreads the real module and replaces getSession alone, the form D85
prefers, and D85 is re-measured: 40 files mock the module, eight of them by spreading it.
The census holds one row per shipped type-id, so rebasing onto main with
the Neo4j provider (#1239) made the record miss a member: a type error and
two failing cases. Neo4j offers no per-row maintenance control and declares
no extension of spec 3.11, so its row is the empty one.
The census holds one row per shipped type-id, so rebasing onto main with
the Db2 provider (#1238) made the record miss a member. Db2 offers analyze
and optimize per row, on both tabs and both row menus, and declares no
operation outside MaintenanceType: 11 of 22 type-ids now offer per-row
controls on the tabs and 10 on the row menus.
…spec names

Main gained MaintenanceOperationSpec.kinds with the Db2 provider (#786):
a per-row control is offered only on the object kinds its operation names.
The two row menus pass the row kind for analyze and vacuum, and now pass
it for the declared operations outside MaintenanceType as well, so a
declared operation that names its kinds is not offered on a view. The
Operations and Tables tabs list tables and name no kind, as before.
@cevheri
cevheri force-pushed the feat/maintenance-preview branch from e8475d0 to 26a96e9 Compare October 3, 2026 13:20
@sonarqubecloud

sonarqubecloud Bot commented Oct 3, 2026

Copy link
Copy Markdown

@cevheri
cevheri merged commit 1170261 into main Oct 3, 2026
35 checks passed
@cevheri
cevheri deleted the feat/maintenance-preview branch October 3, 2026 13:34
cevheri added a commit that referenced this pull request Oct 3, 2026
…n found (#1249)

D152: a SQLite BLOB reaches the standalone grid as an object keyed by byte
index, so no binary reader recognises it (measured in #1248's browser pass on
the branch and on main before it).

D153: the etcd connection-options test makes eight RSA keys in a beforeAll
bounded by bun's default 5 s hook timeout, which ran out once on #1246's CI.

U74: the packaged StudioWorkspace reads process.env unguarded and throws on
mount in a host that defines no process (measured in #1247's browser pass).
cevheri added a commit that referenced this pull request Oct 3, 2026
…und (#1284)

D159, D160 and X24 come from the browser pass of the maintenance extensions (#1246); D161, X25, X26 and X27 from the final acceptance pass of the vector-family work. Each predates that work.

X23 no longer says no shipped engine declares vector columns, and the Chinese README's seed type list gains db2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant