Repository navigation
feat(cli): os deploy and os package publish --install stop on the hosted schema upgrade refusal and take --confirm-upgrade (#30887) - #39286
Conversation
…nstall (#30887) Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
… cloud target (#30887) Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
…sted schema upgrade stop (#30887) Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
…and's own (#30887) Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 13 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 41 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7c22e9464cf5429238c50c5419787ae978ea8346 && git checkout 7c22e9464cf5429238c50c5419787ae978ea8346
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1a66d75c45d2eb969a5353c63358161d1bbdfcd8 0171f212e93d3b39f9857ca3e729e5fdb23427a9 && git checkout -B drift-repro 1a66d75c45d2eb969a5353c63358161d1bbdfcd8 && git merge --no-ff 0171f212e93d3b39f9857ca3e729e5fdb23427a9
node scripts/docs-audit/affected-docs.mjs --json 1a66d75c45d2eb969a5353c63358161d1bbdfcd8
|
…ade stop (#30887) Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:cloud@zhuangjianguo · zhuangjianguo · session_01TsNV8Bsjqmw7aXCo2QuLU1 Contract reviewServed-tier: ① Derived judgments(1) Wire shapes vs cloud: match.
(2) Q3 honoured: yes. No install path gets past a refusal without an explicit token.
(3) Widening: all declared.
(4) Self-hosted behaviour: unchanged.
(5) Tests and ablations: the claims are pinned, with gaps.
(6) Docs (
(7)
CI at the head: 61 check-runs: 42 success, 19 skipped, 0 failure, 0 pending. Required checks are green: Lint & Repo Gates, TypeScript Type Check, Test Core with 12/12 shards, Build Core, Governed Surface Queue Guard, Dogfood Regression Gate, Check Changeset. The PR is still a draft ( ② Findings
③ VerdictFAIL at |
…t and never prints the API key (#30887) os deploy's ObjectOS Cloud retry line and its --json `confirm` named a bare `os deploy`, which re-runs against the active environment: the confirming token is the findings' digest and names no environment, so it could confirm the findings into one whose refusal was never shown. The retry now names the environment that refused (`--env ENV`) and keeps only the typed target flags. os package publish's retry re-printed every argument but --confirm-upgrade, --token included. The retry is now built from an allowlist of flags, walked with the command's own flag specs so a dropped flag's value goes with it. A --json failure reading the deploy target reports target runtime again, as before the cloud target took --json. Adds the cloud d-key, stale-token, --env and --token cases, and corrects the docs' wouldStop row. Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
…nt and never the API key (#30887) Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:cloud@zhuangjianguo · zhuangjianguo · session_01TsNV8Bsjqmw7aXCo2QuLU1 Contract reviewServed-tier: ① Delta judgmentsB1: fixed. The retry and
B2: fixed for both commands.
N2: fixed.
N4: fixed.
N1 (PR body, at 10:15:48Z): fixed. The 要你做 line, the "seat ruled A … cloud#5409" sentence and the Clause-② acceptance note all match. The header keeps the line-initial N3: left as is. It is pre-existing and acknowledged in the PR body. Docs and changeset: they match the code.
Widening: nothing new.
Tests and ablations: the deltas are pinned (above).
CI at the head:
② New findings
③ VerdictPASS at |
Part of #30887
The remaining items (the full plan before install, declared renames in the result,
os deploy --dry-runon cloud) wait on objectstack-ai/cloud#5409, the dry run on cloud's publish install arm (PM ruling, claim amendment 7372140636).Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
The hosted half of #30887, built against the five cloud readings posted on the card (comment 7370246763, cloud
origin/main19dbb424925b).os package publish --installreads the control plane's Q3 refusal (409SCHEMA_UPGRADE_CONFIRMATION_REQUIRED,details.findings/details.findingSet) and prints it through the shared printer: each finding, then both ways forward (renamedFromon the new field, or the same command with--confirm-upgrade TOKEN). Exit 1. The control plane stores no version for a refused install (reading 5), so the text says nothing was published.--confirm-upgrade TOKENonos package publish, sent asconfirm_schema_upgrade(reading 3). It requires--install, and without it the command refuses before any request. The card's Expected 4 rules this flag.os deployon the ObjectOS Cloud target now accepts--confirm-upgradeand--json. On a terminal, the Q3 stop asks the same question as the self-hosted path, and a yes re-sends the same version with the refusal's token.--jsonemits the ruled document withtarget: cloud, andplanandenvironmentstaynullbecause the hosted refusal carries no plan (reading 4). The cloud path moved intodeployToCloud, unchanged apart from these points.os deploy --dry-runstays refused on the cloud target, before anything is built or sent. The message now says why: the hosted preview (GET /api/v1/cloud/packages/:id/upgrade-plan) reads only a stored version, and a deploy always publishes a new one (readings 1 and 2).packages/cli/src/utils/publish-confirm-upgrade.ts, becausepublish.tsis over 1,000 lines. The sharedrenderSchemaUpgradeRefusalgains an optionaljudgeword ("the control plane" vs "the runtime").content/docs/deployment/cli.mdx(os deployflags, the cloud stop and the--jsonkeys;os package publish --confirm-upgradeand its example).Not built, and why this says
Part of: the hosted door does not serve a full plan or a dry run for an unpublished version. So the card's "plan printed before install, grouped by change", "declared renames printed in the result" and a cloud--dry-runare open. The seat ruled A (claim amendment 7372140636): these wait on objectstack-ai/cloud#5409, which is why this PR saysPart of.Read first (riskiest first):
packages/cli/src/commands/deploy.ts,deployToCloud: the question and the re-send (same version, refusal token), andfinishunder--json.packages/cli/src/commands/package/publish.ts, the!verRes.okbranch and the--confirm-upgradeguard.packages/cli/src/utils/publish-confirm-upgrade.ts,retryCommandOf: an allowlist walker over the command's own flag specs. A dropped flag goes with its value, so--tokennever reaches the printed line, and a stale--confirm-upgradeis replaced.deploy.tsCLOUD_RETRY_FLAGSplus the appended--env ENVpin the refused environment.Two-minute check:
pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 test/deploy.test.ts test/package-publish-error-envelope.test.ts. Expect all green, including the#30887hosted cases.Tests
test/deploy.test.tsadds a judging control-plane stub. Its refusal is the exactschemaUpgradeConfirmationRefusalshape, with findings and token from the framework'sschemaUpgradeVerdict. Cases: no-risk installs with no question and no key; the Q3 stop off a terminal (finding,renamedFromhint,os deploy --confirm-upgrade TOKEN, exit 1, one POST, no wait); a terminal yes (second POST, same version, token); a terminal decline;--confirm-upgradeon the first POST; a non-Q3 refusal asks nothing;--jsonrefusal and clean documents;--dry-runrefused with nothing built or sent. The two old cases that pinned "--confirm-upgrade/--jsonrefused on cloud" were removed, because that behaviour is the one this PR replaces.test/package-publish-error-envelope.test.ts, new describe: the publish stop and its retry line,--confirm-upgradesending the key, a stale token re-refused with only the current token named, and--confirm-upgradewithout--installrefused with zero requests.--envretry and--jsonconfirmname--env env_band never the--tokenvalue; an environment resolved without--envis pinned all the same; a terminal yes re-sends into the same environment; a stale--confirm-upgradeis re-refused and the retry names only the current token; theos devd key on the cloud target asks and a decline deploys nothing;--jsonreportstarget: runtimewhen reading the deploy target fails; publish never prints the key given as--token KEY,--token=KEY,-t KEYor-tKEY; the builder drops a dropped flag with its value.Verification
Round 2 readings at head
0171f212e9. Targeted:Tests 96 passed (96). Ablations add B1 (6 red), B2 (5 red), B2-deploy (2 red), B2-arity (7 red) and N2 (1 red), each restored to the HEAD blob. Gates: 102 derived, 102 run, 0 NOT-MEASURED, 0 UNRUN (dual-build-cjs-loads re-ran after its dist prerequisites; query-options-erasure re-ran on a longer bound). CI: 59 check-runs, 42 success, 17 skipped, 0 failure. Round 1 readings follow.Readings at head
f0b2842003(objectstack-ai/objectstack).Targeted tests, typecheck, lint
pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 test/deploy.test.ts test/package-publish-error-envelope.test.ts test/package-install-dry-run.test.ts test/dev-deploy-key.test.ts: exit 0,Test Files 4 passed (4),Tests 84 passed (84).pnpm --filter @objectstack/cli typecheck: exit 0 (check:test-typecheck: OK).eslint --no-inline-configon the 6 changed source and test files: exit 0.unitproject in full: NOT MEASURED, reason: it did not finish inside the container's 10-minute foreground bound under the verify lock (timeout 590answered 124). CI'sTest Coreruns it. Theintegrationtier is declared to CI as well.Ablations (5), each turned its pin red and was restored to the HEAD blob
Each mutation went through
scripts/ablation-replace.mjs: anchor hit 1 to 0, blob changed, then restored with blob equal to HEAD and an emptygit diff HEAD. Tests importsrcdirectly, so there is no build leg.confirm_schema_upgradesend inpublish.ts. 3 red: publish--confirm-upgrade, deploy terminal yes, deploy--confirm-upgrade.--jsonon the cloud path. 1 red: the--jsonrefusal case.publish.ts. 3 red: publish stop, stale token, deploy off-terminal stop.--dry-runon the cloud target. 2 red: both cloud--dry-runcases.Gates: dispatch-gates --commands (102 families) and --ran
node scripts/pm/dispatch-gates.mjs --commandsderived 102 families against merge basef5edfb82d. All 102 exit 0.check:skill-examples,check:dual-build-cjs-loadsand the threecheck:i18n*families exited 3 on an unbuilt CLI, client-react or examples), andcheck:query-options-erasureoutran a 280 s bound.check:cli-examples-paritywas a real finding (exit 1): the new publish example was missing from the docs block, fixed inf0b2842003. After the prerequisites were built, all seven re-ran to exit 0.f0b2842003: all exit 0.node scripts/pm/dispatch-gates.mjs --ran: exit 0,102 derived, 102 run, 0 NOT-MEASURED, 0 UNRUN(a derived zero: every line records its exit code).Acceptance notes
PackagePublishCommand(published from@objectstack/cli) gains the public membersrefusalandretryCommand, whichos deployreads in-process. This is the same seamPackageInstall.outcome/retryCommandgave the self-hosted half, and the changeset declares it. WhenretryCommandis unset, the retry is the run's own arguments without--tokenor--confirm-upgrade.yes (widening), per the seat's ruling in claim amendment 7372140636, and the changeset carries the same line. The level ispatch, because a non-protocol change shipspatch(AGENTS.md).os deploy's retry and its--jsonconfirmalways name the environment that refused, because the confirming token names no environment (review 7373269516, B1 and B2).--confirm-upgradeand--jsonwere refused on ObjectOS Cloud, which this PR makes false.🤖 Generated with Claude Code
https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1