Skip to content

The ADR-0070 read-only gate is missing on package lifecycle: PATCH /packages/:id/disable and DELETE /packages/:id both answer 200 on platform packages, removing them from the running deployment #7560

Description

@huangyiirene

Symptom

Platform packages are supposed to be read-only under ADR-0070. On the package lifecycle routes they are not:

  • PATCH /packages/<id>/disable on a platform package → 200.
  • DELETE /packages/<id> on a platform package → 200, and the code package is actually removed from the registry listing.

Reproduced on two platform packages.

Expected: both operations refuse a platform package with the ADR-0070 read-only refusal, the way other protected-resource writes do.

Blast radius, stated precisely: the packages come back after a restart — they are code-loaded, so nothing is permanently destroyed — but the running deployment loses them until then. A single API call takes platform functionality out of a live deployment with no way back short of a restart.

Root cause

Not located by the report. What it establishes is that the refusal is simply absent on these two routes: they execute the lifecycle operation and answer success rather than declining a protected package. The package domain lives in packages/runtime/src/domains/packages.ts (per #7033's census), which is why this is filed domain:cli.

Not covered by the recent /packages authorization work

#7033 ("/packages 域整体没有授权判据") was closed on 2026-08-09 by PR #7083, which added caller authorization to the whole domain — writes require manage_metadata, reads require the D4 read set, plus a domain-wide anonymous gate. That fix landed before this run's framework commit was cut, and it is on a different axis: it decides who may call the route. This card is about what the route may do once the caller is allowed — an authorized admin can still disable and delete a platform package. So this is neither a duplicate of #7033 nor a regression of it; the read-only gate is a second, missing check on the same routes.

Reproduction

  1. Boot the platform and list /packages; pick a code-loaded platform package (repeated with a second one).
  2. PATCH /packages/<id>/disable → 200.
  3. DELETE /packages/<id> → 200; re-list /packages — the package is gone from the registry listing of the running process.
  4. Restart — the package is back, confirming it is code-loaded and the loss is confined to the running deployment.

Source

Extracted from the QA run #7514 (framework a86db17, console 09987b68).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions