Repository navigation
Commit 43460b9
feat(spec)!: remove the three unmounted PackageApiContracts entries (upgrade / resolve-dependencies / upload) (#19937)
Fixes #19116
Clause-②: no
Executes ruling 5793374037 on #19116 (batch #217 item 4, letter A,
maintainer 「217 同意」): the three `PackageApiContracts` entries that named
paths nothing mounts leave the contract map.
## What changed
- **`packages/spec/src/api/package-api.zod.ts`**
- `PackageApiContracts` loses `upgradePackage` (`POST
/api/v1/packages/upgrade`), `resolveDependencies` (`POST
/api/v1/packages/resolve-dependencies`) and `uploadArtifact` (`POST
/api/v1/packages/upload`). A comment at the removal site records why,
and carries ruling item 3: a package upgrade / dependency-resolution /
upload entry is declared only in the same change that mounts its route.
- The file-header `Endpoints` list loses the same three lines (this is
the text the generated reference page prints).
- Docblock-only corrections under the dispatch's Zone 2 exception, no
shape change, no `.describe()` touched:
1. section header `// 5. Upgrade Package (POST
/api/v1/packages/upgrade)` now reads `(request/response shapes — bound
to no route, see §11)`;
2. `PackageUpgradeRequestSchema` JSDoc: the `@example POST
/api/v1/packages/upgrade` request line is dropped (the example body
stays) and one sentence says no route accepts it;
3. section header 6 (`resolve-dependencies`), same edit as 1;
4. `ResolveDependenciesRequestSchema` JSDoc, same edit as 2;
5. section header 7 (`upload`), same edit as 1;
6. `UploadArtifactRequestSchema` JSDoc, same edit as 2, and the
`Content-Type: multipart/form-data` line goes with the request line,
because it described the HTTP request of the unmounted route.
- **`packages/spec/src/api/package-api.test.ts`**: the three
`toBeDefined` / method / path pins on the removed keys are flipped into
a new block that asserts the new fact: none of the three keys is
present; no entry under any key is bound to any of the three paths (the
whole map is swept, so a phantom cannot return under another key); the
map holds exactly the four serving entries; and the six per-route
schemas still resolve from the `api` namespace (scope of the ruling, see
Acceptance notes).
- **ADR-0087**: D3 semantic entry
`package-api-contracts-unmounted-entries-retired`
(`packages/spec/src/migrations/entries/semantic/18.package-api-contracts-unmounted-entries-retired.ts`),
concatenated into `registry.ts` by `gen:migration-registry`. A
contract-map entry is not metadata, so there is no source a D2
conversion could rewrite.
- **Generated**: `content/docs/references/api/package-api.mdx`
regenerated by `check:generated --fix` (only `check:docs` was proven
stale): the three lines are gone. ⛔ Not hand-edited. `spec-changes.json`
/ `docs/protocol-upgrade-guide.md` were NOT stale (step-18 semantic
entries are not projected yet), measured by `check:spec-changes` /
`check:upgrade-guide` green.
- **Changeset**
`.changeset/19116-package-api-unmounted-entries-retired.md`:
`@objectstack/spec` **minor** with a **BREAKING** banner, a FROM → TO
table and the one-line fix, and the ADR-0087 disposition `registered
package-api-contracts-unmounted-entries-retired`. Level chosen by the
launch-window convention: `scripts/check-changeset-no-major.mjs` refuses
`major` outside pre-mode (`.changeset/pre.json` absent), and ruling
5770445652 on #19611 (batch #210 item 3) ratified `minor` + BREAKING
banner + ADR-0087 marker as the carrier for a breaking spec retirement.
Rule text read: AGENTS.md Post-Task Checklist step 3 (breaking
changesets carry FROM → TO + one-line fix; exactly one ADR-0087 marker;
the changeset carries the PR's `Clause-②` line).
Runtime behaviour is unchanged: nothing mounted the three paths or built
a route from the entries.
## Premise re-taken at `fdeeea0cc9` (this branch's base)
- The three path strings occur in exactly 3 files (`package-api.zod.ts`,
`package-api.test.ts`, `content/docs/references/api/package-api.mdx`),
`.map` and `CHANGELOG.md` excluded; control `/api/v1/packages/publish`:
27 files.
- `upgradePackage` occurs only in the two spec files.
`resolveDependencies` / `uploadArtifact` also occur in `packages/core`
kernels and `packages/spec/src/contracts/package-service.ts`: those are
the kernel's plugin sort and the `IPackageService` methods, a different
surface, not readers of the map.
- No reader of `PackageApiContracts` outside `package-api.test.ts`
(non-generated, non-changeset); no route table, client method,
SDK/codegen, MCP tool or doc generator iterates it.
`handlePackagesRequest` (`packages/runtime/src/domains/packages.ts`) has
no single-segment `POST` branch, so the three paths fall through (static
read; the dynamic `handled=false` reading is the one recorded on
#18604).
- objectui at the pin `62597c58` (the sibling checkout's HEAD equals
`.objectui-sha`): 0 files for `PackageApiContracts`, each of the three
keys, each of the three paths; controls
`GetMetaItemLayeredResponseSchema` 14 files, `/api/v1/packages` 33
files.
## Verification (all at head `3c4da3412`)
- `pnpm --filter @objectstack/spec build` (under the verify lock) → exit
0.
- `pnpm --filter @objectstack/spec test` → 527 files, 15507 passed / 1
todo, exit 0. `test:repo` → 35 files, 602 passed, exit 0. `typecheck`
(tsc + scripts + test-typecheck) → exit 0.
- Cross-package suites whose turbo inputs cover the diff:
`@objectstack/core` / `types` / `runtime` / `objectql` / `rest`
`test:repo` → 3/1/2/1/1 files, all passed (runtime and objectql after
building their dependency closure; the first runtime attempt refused on
unbuilt dependencies and is not counted).
- `@objectstack/downstream-contract` `test` → 2 files passed, 1 file NOT
MEASURED: `consumer-specifier-ledger.test.ts` refuses because
`@objectstack/cli` is not built; it measures published export
specifiers, which this diff does not move.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` → 111 commands, each run with its exit code
recorded; `--ran` reconciliation: **111 derived, 109 run, 2 NOT
MEASURED, 0 UNRUN**.
- NOT MEASURED, reason PREREQUISITE NOT MET (exit 3, a whole-tree
build): `pnpm check:dual-build-cjs-loads`, `pnpm check:type-check-debt`.
Both are in CI's required jobs.
- Three families first exited 3 (`@objectstack/lint`
`check:doc-formula-expressions` / `check:doc-security-posture`,
`@objectstack/spec` `check:skill-examples`); after building their named
prerequisites (`turbo run build` for formula, lint, client-react, 34
tasks) all three exited 0.
- `check:adr-0087-registration`: `1 declared-breaking changeset(s), each
carrying an ADR-0087 disposition … registered
package-api-contracts-unmounted-entries-retired (new here …)`.
- The 11 declared wide-population families (CI-owned) were also run,
because they walk `packages/**/*.ts` and this diff adds prose to
`registry.ts`: all exit 0.
- Lint, narrowed and proven: `eslint --no-inline-config --format json`
over the 4 changed `.ts` files → 4 files, 0 errors, 0 warnings.
Population read from eslint's own config: `--print-config` resolves for
all four; the changeset `.md` and the `.mdx` are outside it (`File
ignored because no matching configuration was supplied`). Invariance:
`eslint.config.mjs` enables no type-aware linting (the resolved
`parserOptions` carry only `ecmaVersion` / `sourceType`, no `project` /
`projectService`), so this diff cannot move a verdict on an untouched
file.
- Reverse verification against the rebuilt `dist/api/index.d.mts`: a
probe reading `PackageApiContracts.upgradePackage` /
`.resolveDependencies` / `.uploadArtifact` → `TS2339` on each (tsc exit
2); the control leg reading `.installPackage.path` alone → exit 0.
Direction observed: red, as expected.
- Ablation of the new pins (`scripts/ablation-replace.mjs`, wrap mode,
under the verify lock): re-planting an `upgradePackage` entry (anchor 1
→ 0, blob `d2f65040` → `9173ef90`) turned 3 of the 4 new tests red
(`expected true to be false`, `expected [ 'upgradePackage' ] to deeply
equal []`, `expected [ Array(5) ] to deeply equal [ Array(4) ]`); the
schemas-still-published test stayed green, as it should. Restore proven:
blob back to HEAD `d2f65040`, `git diff HEAD` empty. The restored leg:
`package-api.test.ts` 78/78 passed. 1 parent 24d1a2d commit 43460b9
6 files changed
Lines changed: 208 additions & 43 deletions
File tree
- .changeset
- content/docs/references/api
- packages/spec/src
- api
- migrations
- entries/semantic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | 508 | | |
512 | 509 | | |
513 | 510 | | |
514 | 511 | | |
515 | 512 | | |
516 | 513 | | |
517 | 514 | | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | 515 | | |
522 | 516 | | |
523 | 517 | | |
| |||
530 | 524 | | |
531 | 525 | | |
532 | 526 | | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | 527 | | |
537 | 528 | | |
538 | 529 | | |
| |||
546 | 537 | | |
547 | 538 | | |
548 | 539 | | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
549 | 595 | | |
550 | 596 | | |
551 | 597 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
| |||
563 | 560 | | |
564 | 561 | | |
565 | 562 | | |
566 | | - | |
| 563 | + | |
567 | 564 | | |
568 | 565 | | |
569 | 566 | | |
570 | | - | |
| 567 | + | |
| 568 | + | |
571 | 569 | | |
572 | | - | |
| 570 | + | |
573 | 571 | | |
574 | 572 | | |
575 | 573 | | |
| |||
629 | 627 | | |
630 | 628 | | |
631 | 629 | | |
632 | | - | |
| 630 | + | |
633 | 631 | | |
634 | 632 | | |
635 | 633 | | |
636 | | - | |
| 634 | + | |
| 635 | + | |
637 | 636 | | |
638 | | - | |
| 637 | + | |
639 | 638 | | |
640 | 639 | | |
641 | 640 | | |
| |||
661 | 660 | | |
662 | 661 | | |
663 | 662 | | |
664 | | - | |
| 663 | + | |
665 | 664 | | |
666 | 665 | | |
667 | 666 | | |
668 | | - | |
| 667 | + | |
| 668 | + | |
669 | 669 | | |
670 | | - | |
671 | | - | |
| 670 | + | |
672 | 671 | | |
673 | 672 | | |
674 | 673 | | |
| |||
851 | 850 | | |
852 | 851 | | |
853 | 852 | | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
872 | 863 | | |
873 | 864 | | |
874 | 865 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments