Skip to content

Start under another release name; withdraw 0.5.7 (APT-1102) - #34

Merged
reoring merged 3 commits into
mainfrom
fix/prompt-version-release-revision
Nov 15, 2026
Merged

reoring merged 3 commits into
mainfrom
fix/prompt-version-release-revision

Conversation

@reoring

@reoring reoring commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

朝の 5 行(森さん向け)

  1. 何が変わるか: (a) Console が、別の版の名前で起動できるようになる(会話の prompt の版の登録で、「どの版の Console か」を比べない。内容の hash だけを比べる)。(b) 発行の道具に「取り下げる版」の欄を足し、0.5.7 を載せる(送る中身では served: false。0.5.7 の再発行を断る)。ただし、いまは環境まで届かない: カタログを出す側(Cloud)と、Platform のカタログの取り込みが、どちらも全部の版を served: true に書き直す(APT-1105)。環境に届く効果は「既定が新しい版に移る」だけ。0.5.7 は、手で選べば、まだ入る。
  2. 届いたときに見える変化・止まるもの: この変更を含む版(0.5.8 の見込み)は、0.5.6 から上げられ、そのあとも上げ下げできる。0.5.7 は、入れると、製品の道では版を変えられない(ink で実測、APT-1102)。0.5.7 を入れてある所(ink の検証用の Project だけ)は、この版でも、そのままでは上がらない(Platform の 1 段目が、0.5.7 の実行ファイルを新しい版の名前で起動するため)。入れ直しが要る。
  3. 決めてほしい点と推奨: (a) マージするか → 推奨: マージ。(b) 0.5.8 を発行するか(戻せない)→ 推奨: 発行(カタログの既定が、いま 0.5.7。新しく入れると罠に入る)。(c) APT-1094(断られた計画の見せ方)を同じ版に入れるか → 別の PR。間に合えば同じ版。
  4. 独立レビュー: 「マージしてよい。後続の指摘つき」(head 8eccf4c。Go の変更に指摘なし。取り下げが下流で効かない = 上の 1(b)、APT-1105)。そのあとの commit は、README とコメントの文言だけ。確かめていないこと: Platform の入れ替えの動きそのもの(AppInstallation → transition → Knative)。下の smoke は、実行ファイル・版の名前・DB の組み合わせだけを確かめる。カタログを出す側(appthrust/cloud)が served: false をそのまま通すかは、未確認。
  5. 戻し方: revert(migration なし。DB の形は変えない)。0.5.8 を発行したあとは、発行は戻せない(次の版で直す)。この版から 0.5.6 への下げは、smoke で通った(G1〜G3)。

What (APT-1102, urgent; part of APT-1096)

Prompt registration now identifies a prompt version solely by its schema version, template hash and schema hash. The release revision remains immutable provenance of its first registration rather than a startup compatibility requirement, allowing identical prompt content to survive upgrades, downgrades and the Platform's config-first/image-second rollout. Real PostgreSQL regressions cover existing and initially empty registrations, repeated restarts in both directions, provenance preservation, and continued rejection of content mismatches.

The publisher gains a publisher-only withdrawnVersions key in catalog/entry.yaml: a listed version is submitted with served: false and cannot be published again. 0.5.7 is listed. The flag does not reach estates today - Cloud (apps/api/src/catalog-contract.ts) and the Platform (app_catalog_source_artifact.go) both write served: true for every version (APT-1105) - so the effective change is that the default moves to the new release.

Why

Observed on ink (2026-11-15): changing an installed 0.5.7 to another version never became ready. The Platform changes an app's version in two steps - the new version's configuration on the old image, then the new image. In step 1 the 0.5.7 binary started under the other version name; RegisterBuildPromptVersion compared release_revision (from BUILDER_CONSOLE_RELEASE_VERSION) with the stored row and refused: conflict: Prompt version is already registered with different content, every 30 s, never ready; step 2 never ran. The same happens for an upgrade from 0.5.7. Users were not affected (the previous revision kept serving), but the version could be neither raised nor lowered, and the stuck change took about 20 minutes to fail.

Smoke: real images, one real PostgreSQL, in the Platform's order

Each row starts the named image with the named BUILDER_CONSOLE_RELEASE_VERSION against the same database as the rows above it in its group and reads /readyz. local is this branch's server binary on top of the 0.5.7 image (the SPA is irrelevant to startup). Containers and the database were removed afterwards.

Reproduction of the defect with published images

scenario image release name /readyz prompt row last log
R1 baseline 0.5.7 0.5.7 0.5.7 READY 0.5.7,
R2 ink failure: downgrade step 1 0.5.7 0.5.6 not-ready 0.5.7, 2026/11/15 12:36:36 console database unavailable, retrying in 30s: conflict: Prompt version is already registered with different content
R3 upgrade step 1 from 0.5.7 0.5.7 0.5.8 not-ready 0.5.7, 2026/11/15 12:37:18 console database unavailable, retrying in 30s: conflict: Prompt version is already registered with different content
R4 baseline 0.5.6 0.5.6 0.5.6 READY (no table)
R5 0.5.6 -> 0.5.7 step 1 0.5.6 0.5.7 READY (no table)
R6 0.5.6 -> 0.5.7 step 2 0.5.7 0.5.7 READY 0.5.7,
R7 0.5.6 binary on a 0.5.7 database 0.5.6 0.5.6 READY 0.5.7,

This branch

scenario image release name /readyz prompt row last log
F1 start: 0.5.6 0.5.6 0.5.6 READY (no table)
F2 up step 1 (0.5.6 image, name 0.5.8) 0.5.6 0.5.8 READY (no table)
F3 up step 2 (fixed, 0.5.8) local 0.5.8 READY 0.5.8,
F4 next up step 1 (fixed, name 0.5.9) local 0.5.9 READY 0.5.8,
F5 next up step 2 (fixed content, 0.5.9) local 0.5.9 READY 0.5.8,
G1 start: fixed 0.5.8 local 0.5.8 READY 0.5.8,
G2 down step 1 (fixed, name 0.5.6) local 0.5.6 READY 0.5.8,
G3 down step 2 (0.5.6 image, 0.5.6) 0.5.6 0.5.6 READY 0.5.8,
G4 back up (fixed, 0.5.8) local 0.5.8 READY 0.5.8,
H1 start: 0.5.7 0.5.7 0.5.7 READY 0.5.7,
H2 fixed 0.5.8 directly on a 0.5.7 database local 0.5.8 READY 0.5.7,
H3 (reference) 0.5.7 image, name 0.5.8 on same database 0.5.7 0.5.8 not-ready 0.5.7, 2026/11/15 12:38:24 console database unavailable, retrying in 30s: conflict: Prompt version is already registered with different content
  • R2/R3 reproduce the ink failure and show that an upgrade from 0.5.7 fails the same way.
  • F1-F5: 0.5.6 → this branch → the next version, in the two-step order: all ready. The stored release_revision stays the first registration's (0.5.8).
  • G1-G4: this branch → 0.5.6 → back: all ready (a downgrade to 0.5.6 works).
  • H2: this branch starts directly on a database written by 0.5.7. H3: the 0.5.7 binary under the new name still refuses - an existing 0.5.7 installation cannot be upgraded through the two-step path by any later release; it needs a reinstall or a one-step change (APT-1103).

Limits: this does not exercise the Platform's rollout (AppInstallation → ContainerInstanceTransition → Knative), routing, or real configuration; the local binary was built with the host Go toolchain, not the Dockerfile's.

Not changed

  • No migration; the immutability trigger is untouched.
  • A genuinely different template/schema under the same prompt id still fails startup. Nothing enforces a new id when prompt content changes other than the golden test's message (-update can rewrite the goldens under the same id) - follow-up.

Checks (on the committed tree, head 8eccf4c for Go; docs-only commit after)

go vet ./cmd/server/..., go test ./cmd/server/... -count=1 against PostgreSQL 17 (BUILDER_CONSOLE_TEST_DATABASE_URL, UTC), bun test hack. Not run: web checks (no web change), image build through the Dockerfile.

…t only (APT-1102)

At every startup the server registers its prompt version and refused to become
ready unless the stored row's release revision matched the running release.
The Platform changes an app's version in two steps (the new version's
configuration on the old image, then the new image), so a 0.5.7 binary started
under any other version name never became ready and the version could be
neither raised nor lowered. The release revision is now provenance of the
first registration: stored on insert, never compared, never updated. Different
template or schema content under the same id still conflicts.
An installation of 0.5.7 cannot change version, so nothing should install or
move to it. The publisher marks versions listed under the publisher-only
withdrawnVersions key as served: false and refuses to publish them.
@reoring reoring added the needs-human-review Waits for a person's review before merge label Nov 15, 2026
@reoring

reoring commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Merging on the PO lead's decision (森さん's instruction of 2026-11-15 to ship 0.5.8): independent review merge OK with noted follow-ups on 8eccf4c (no finding on the Go change; the follow-up that withdrawal does not reach estates is APT-1105 and the wording was corrected in 844905f, docs only); all six checks pass on 844905f; the smoke table in the description passed, including the downgrade to 0.5.6; the publisher output was parsed with Cloud's catalogEntrySchema at 58a8d761 (accepted; served is stripped).

@reoring reoring removed the needs-human-review Waits for a person's review before merge label Nov 15, 2026
@reoring
reoring merged commit f82528b into main Nov 15, 2026
6 checks passed
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