|
@@ -684,6 +684,12 @@ docker run -d --name svapi-dev -p 8080:8080 -e SMARTBOTIC_VECTORAPI_KEY=dev svap
|
|
|
Two things they measured that are worth keeping because I could not have answered them from our side either. Their old 5xx arm was `/\b5\d\d\b/` over the message text, which equally matches a port in `127.0.0.1:502`, a byte count or a year - **a three-digit-number check wearing a status check's name** - and it is gone now that `e.status` is known to exist. And a test they had written an hour earlier asserting the slug was read out of the MESSAGE passed against `'vectorapi 504 {"error":"embedding_timeout"}'`, a string that also contains the word "timeout", so the prose arm answered and the assertion could not tell which arm had produced it: green, and blind to the only thing its name mentioned.
|
|
Two things they measured that are worth keeping because I could not have answered them from our side either. Their old 5xx arm was `/\b5\d\d\b/` over the message text, which equally matches a port in `127.0.0.1:502`, a byte count or a year - **a three-digit-number check wearing a status check's name** - and it is gone now that `e.status` is known to exist. And a test they had written an hour earlier asserting the slug was read out of the MESSAGE passed against `'vectorapi 504 {"error":"embedding_timeout"}'`, a string that also contains the word "timeout", so the prose arm answered and the assertion could not tell which arm had produced it: green, and blind to the only thing its name mentioned.
|
|
|
**WHAT THE HOST ACTUALLY GIVES A FUNCTION, since this keeps being asked and is answerable only from source** (`throwApiError`, `runner/src/host_context.cpp:138`): a JS `Error` carrying `message`, **`code`** (the slug), **`status`** (the HTTP status the same error would have had) and `details` as a real object when non-empty. So `e.code` is a FIELD and digging a slug out of the stringified message is a branch that can never fire for a host-raised error. `host_prelude.js`'s own `fail()` sets `code` the same way, so both halves of the surface agree. And `rate_limited` and `memory_pressure` BOTH reach a function - the first through `requireCapabilityCore` charging the policy's limit on `ctx.collections` data access (a separate bucket from the `/fn` request charge, so a function can be admitted at the request and refused on its data access), the second through the same `translate()` both surfaces use.
|
|
**WHAT THE HOST ACTUALLY GIVES A FUNCTION, since this keeps being asked and is answerable only from source** (`throwApiError`, `runner/src/host_context.cpp:138`): a JS `Error` carrying `message`, **`code`** (the slug), **`status`** (the HTTP status the same error would have had) and `details` as a real object when non-empty. So `e.code` is a FIELD and digging a slug out of the stringified message is a branch that can never fire for a host-raised error. `host_prelude.js`'s own `fail()` sets `code` the same way, so both halves of the surface agree. And `rate_limited` and `memory_pressure` BOTH reach a function - the first through `requireCapabilityCore` charging the policy's limit on `ctx.collections` data access (a separate bucket from the `/fn` request charge, so a function can be admitted at the request and refused on its data access), the second through the same `translate()` both surfaces use.
|
|
|
|
|
|
|
|
|
|
+- **ADDING A KEY TO `config/config.json` ABORTED A PROD INSTALL MID-TRANSACTION, BECAUSE THAT FILE IS A dpkg CONFFILE AND EVERY REAL DEPLOYMENT HAS CUSTOMISED IT (0.18.1, 2026-11-03).** `create-debs.sh:88` writes `/etc/smartbotic-vectorapi/config.json` into `DEBIAN/conffiles`. Prod's copy carries `functions.runners`, the scheduler and the events block, none of which are in the shipped template - so the moment the template changed AT ALL, dpkg had a genuine three-way conflict, asked which version to keep, found no controlling tty, and exited 1 **after unpacking and before configuring**.
|
|
|
|
|
+ **The half-configured state is the part worth recognising, because every obvious signal looked fine.** `systemctl is-active` said active for all three units, `/healthz` answered 200, `NRestarts` was 0 - and `dpkg-query` said `install ok unpacked` rather than `installed`, with the running process still executing the OLD image from a replaced inode. So prod was serving correctly on the PREVIOUS version while the new binary sat on disk, which is a state no liveness check can distinguish from a successful deploy. **Read `${Status}` from `dpkg-query`, not `systemctl is-active`, when deciding whether an install finished.**
|
|
|
|
|
+ Repaired with `DEBIAN_FRONTEND=noninteractive dpkg --configure -a --force-confold`, which logs **"Using current old file as you requested"** - and prod's config was proven untouched by md5 either side (`312ec347...` before and after) rather than asserted.
|
|
|
|
|
+ **THE CONTROL, not the warning: the install must carry a conffile policy, because the prompt is not a consequence of editing the template - it is a consequence of the file being a conffile that every box customises.** Reverting my template change does not fix it; the next template change of any kind would do the same thing. So a prod install of these packages runs `-o Dpkg::Options::=--force-confold` with `DEBIAN_FRONTEND=noninteractive`, and `--force-confdef` alongside it so a conffile the operator has NOT customised still takes the new default. Without that, any future template edit is an aborted transaction on every customised box.
|
|
|
|
|
+ **And the template change itself was reverted, because it bought nothing it could not get elsewhere.** `database.timeout_ms` is documented in `src/config.hpp` and in `api/llms.txt`, and it defaults to the value that was previously hardcoded, so shipping it in a conffile only bought one prompt per box. **An OPTIONAL key with a correct default does not belong in a conffile**; a conffile should hold what a deployment must set, not a catalogue of what it may.
|
|
|
|
|
+
|
|
|
## Deploy / publish
|
|
## Deploy / publish
|
|
|
|
|
|
|
|
**`VERSION` and `api/openapi.json`'s `info.version` must agree, and `packaging/build.sh` now refuses to build unless they do** (`scripts/check-version-sync.sh`, run at the top level so it covers the local, Docker and publish paths alike). They drifted once: 0.10.0 was published with the docs claiming 0.9.2, and since `openapi.json` ships in the server package and is served at `/openapi.json`, the stale value was live. **Correcting it cost a whole release**, because a published version number is never reused for different content - which is why 0.10.0 exists but must never be deployed. A release step that relies on remembering is a release step that gets skipped, so it is a check rather than a checklist line.
|
|
**`VERSION` and `api/openapi.json`'s `info.version` must agree, and `packaging/build.sh` now refuses to build unless they do** (`scripts/check-version-sync.sh`, run at the top level so it covers the local, Docker and publish paths alike). They drifted once: 0.10.0 was published with the docs claiming 0.9.2, and since `openapi.json` ships in the server package and is served at `/openapi.json`, the stale value was live. **Correcting it cost a whole release**, because a published version number is never reused for different content - which is why 0.10.0 exists but must never be deployed. A release step that relies on remembering is a release step that gets skipped, so it is a check rather than a checklist line.
|