|
1159 | 1159 | "title": "Package REST lifecycle: POST /packages creates (201), a duplicate name is refused 409 (no silent manifest clobber), PATCH partial-patches the manifest, and an explicit overwrite re-install replaces in place without duplicating", |
1160 | 1160 | "since": "v16", |
1161 | 1161 | "status": "active", |
1162 | | - "revision": 5, |
| 1162 | + "revision": 6, |
1163 | 1163 | "priority": "P2", |
1164 | 1164 | "surface": "api", |
1165 | 1165 | "personas": [ |
|
1182 | 1182 | "PATCH three malformed bodies: { name: '' }, { version: 'not-semver' }, and {} (nothing to update); capture each rejection", |
1183 | 1183 | "re-install with the explicit opt-in: POST /api/v1/packages?overwrite=true (or body { overwrite: true }) carrying the same id and a changed manifest (version 2.0.0); capture status", |
1184 | 1184 | "GET /api/v1/packages and count rows whose id == com.example.qa-pkg-lifecycle-probe — must be exactly one", |
1185 | | - "confirm the LIVE routing seam: POST /api/v1/packages resolves to the dispatcher install route (REST moved marketplace publish OFF the bare path to POST /api/v1/packages/publish in #3610), and PATCH /api/v1/packages/:id answers non-404 though it is absent from packages/rest/src/rest-route-ledger.ts (dispatcher-only)" |
| 1185 | + "confirm the LIVE routing seam: POST /api/v1/packages resolves to the dispatcher install route (REST moved marketplace publish OFF the bare path to POST /api/v1/packages/publish in #3610), and PATCH /api/v1/packages/:id answers non-404 though it is absent from packages/rest/src/rest-route-ledger.ts (dispatcher-only)", |
| 1186 | + "restart: after steps[6], stop the server and boot it again on the SAME database (the same file DB, never --fresh); then GET /api/v1/packages/com.example.qa-pkg-lifecycle-probe and GET /api/v1/packages, and set both beside the same reads taken just before the stop" |
1186 | 1187 | ], |
1187 | 1188 | "acceptance": [ |
1188 | 1189 | { |
|
1220 | 1221 | "oracle": "api", |
1221 | 1222 | "verify": "POST /api/v1/packages installs (not a 400 publish-shape rejection); PATCH /api/v1/packages/:id answers non-routing-404", |
1222 | 1223 | "evidence": "the two traces" |
| 1224 | + }, |
| 1225 | + { |
| 1226 | + "clause": "the manifest served after a restart equals the last one written: once the server restarts on the same database, GET /api/v1/packages/com.example.qa-pkg-lifecycle-probe answers the manifest of the steps[5] overwrite (version 2.0.0 and the fields it changed), never the PATCHed 1.1.0 manifest or the 1.0.0 install, and GET /api/v1/packages still lists exactly one row for the id", |
| 1227 | + "oracle": "api", |
| 1228 | + "verify": "compare the post-restart GET with the pre-restart GET of the same id: name, description, version and dependencies equal. The registry is rebuilt at boot from sys_packages: installPackage and updatePackage each persist the merged manifest through the package service's publish (packages/metadata-protocol/src/protocol-package-install.ts#updatePackage; a failed persist fails the write, #21243), publish stamps updated_at to the millisecond (packages/services/service-package/src/package-table.ts#packageWriteStamp), and the boot hydrates each id from its row written last (packages/services/service-package/src/index.ts, list() and the hydration loop that calls registry.installPackage). A pre-restart read that matches while the post-restart read shows an earlier version or name is the FAIL this clause exists for", |
| 1229 | + "evidence": "the pre- and post-restart GET bodies + the post-restart list count" |
1223 | 1230 | } |
1224 | 1231 | ], |
1225 | 1232 | "negative": [ |
1226 | 1233 | "a second POST of the same id answering 2xx and silently replacing the manifest is the #2995 data-loss FAIL (the whole reason the 409 guard exists)", |
1227 | 1234 | "a PATCH that resets enabled/status/installedAt (a full replace masquerading as a partial patch) is a FAIL", |
1228 | | - "an overwrite re-install that leaves two rows for one id in GET /api/v1/packages is a FAIL (duplication, not replacement). Two sys_packages rows for one id at two versions are not this FAIL: the table is (id, version)-keyed by design (packages/services/service-package/src/package-table.ts)" |
| 1235 | + "an overwrite re-install that leaves two rows for one id in GET /api/v1/packages is a FAIL (duplication, not replacement). Two sys_packages rows for one id at two versions are not this FAIL: the table is (id, version)-keyed by design (packages/services/service-package/src/package-table.ts)", |
| 1236 | + "a restart that serves an earlier manifest than the last write (the PATCH or the overwrite lost, or an older version's row winning the boot hydration) is a FAIL: the edit was answered as stored and is gone" |
1229 | 1237 | ], |
1230 | 1238 | "traps": [ |
1231 | 1239 | "dispatcher-vs-hono-route" |
|
1267 | 1275 | "date": "2026-11-14", |
1268 | 1276 | "change": "acceptance[0].clause and negative[2] re-pointed (stale spec, card #33332; QA run #33081 comment 6850173588). sys_packages is keyed by (id, version) by design (service-package package-table.ts, PRIMARY KEY (id, version)), so after the 2.0.0 overwrite the table can hold two rows for the id. The item now names the list door GET /api/v1/packages, which reads the registry (one entry per id), as the oracle for every one-row count, and says two version rows in the table are not the duplication FAIL. The run's other note, a clause that the manifest served after a restart equals the last one written, is a new clause and is left for a coverage pass. Read from source at base fca5f89c", |
1269 | 1277 | "ref": "#33332" |
| 1278 | + }, |
| 1279 | + { |
| 1280 | + "revision": 6, |
| 1281 | + "date": "2026-11-14", |
| 1282 | + "change": "steps[8], acceptance[6] and negative[3] added (coverage, card #33353 row 196; card-B-api-4 of QA run #33081, comment 6850173588, ledger row 196 of #32908). No clause said the manifest served after a restart equals the last one written, and the in-memory registry would pass every other clause while the durable copy was wrong. The new clause reads the detail door after a restart on the same database against the read before it. Source on main: updatePackage and installPackage persist through the package service's publish and fail the write when the persist fails (protocol-package-install.ts), publish stamps updated_at to the millisecond (package-table.ts packageWriteStamp), and the boot hydrates each id from its latest row (service-package index.ts list() and its hydration loop). The existing clauses are unchanged. Read from source at base bd439f17, not driven live", |
| 1283 | + "ref": "#33353" |
1270 | 1284 | } |
1271 | 1285 | ] |
1272 | 1286 | }, |
|
0 commit comments