Repository navigation
Cloud session bootstrap and DRAGON_REQUIRE_NATIVE (cloud migration items 1 and 4) - #219
Merged
Merged
Conversation
…Apps kept the host in the scaled window one scene rotation left, so capture trust's OS screenshot showed the wallpaper
# Conflicts: # packages/parity/test/device-run.test.ts
…t lanes rerun, so the device records await the landing driver's device run)
…ems 1 and 4) scripts/cloud-setup.sh, run by the project SessionStart hook only when CLAUDE_CODE_REMOTE=true, installs the Node every workflow pins and the pnpm of packageManager, then pnpm install --frozen-lockfile and pnpm setup:git, which now also turns rerere off. DRAGON_REQUIRE_NATIVE=1 turns a native run with a missing toolchain from blocked (owner tooling) into a failure naming the tool, in runTarget and runHostLane, as CI's "No native run was blocked" step does.
…atch mode) regen-on-ci.yml takes a sha (patch mode): no push, run-name "regen of <sha>", the combined outputs.patch uploaded as regen-patch, every cache restored only. land-devices-ci.ts adds the regen workflow, land-regen/c-<sha> scratch branches and the patch application; land.ts sends its four regen call sites and the parallel preparations through it.
…then the merge drivers) floor-merge.test.ts pins pnpm setup:git to exactly what the landing driver sets; rerere.enabled false joins both, so the exact-equality check stays and covers the new line.
The master warm run no longer yields to patch-mode runs; a regen step cut off (timeout, lost runner, cancel) is CiUnavailable, only one that completed with failure blames the tree; patch mode does not use setup-node's saving pnpm cache; DEFAULT_REGEN_WAIT_S covers the 6-round chain; a commitApart error is CiUnavailable; the regen commit names the CI run; abandonCiRun says CI run.
…_NATIVE=1, prove the Linux path in CI Review of 892a687: the hook now has no matcher, so it reruns after compact, clear and fork (compaction drops CLAUDE_ENV_FILE exports); in a cloud session the script writes export DRAGON_REQUIRE_NATIVE=1 to CLAUDE_ENV_FILE first (PM ruling) and fails without that file; only the summary line reaches stdout; npm --prefix; curl --retry-connrefused. ci.yml's checks job runs on ubuntu-24.04 and runs cloud-setup.sh twice before setup-node, checking Node, pnpm, the export, typecheck and no reinstall.
Commands: pnpm regen; pnpm run parity:devices; pnpm regen
Commands: pnpm regen
Commands: pnpm regen; pnpm run parity:devices; pnpm regen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cloud migration plan (docs/goals/milestone-2-proof/notes/cloud-migration.md), items 1 and 4.
What changed
Item 1, session bootstrap
scripts/cloud-setup.sh: exits 0 at once unlessCLAUDE_CODE_REMOTE=true(the documented cloud-session marker), so it is a no-op locally. In a cloud session it reads the Node pin from.github/workflows(the one fullx.y.znode-version, currently 24.15.0; a major-only pin must match its major, any other value fails), and the pnpm pin frompackage.jsonpackageManager(10.33.2). It downloads Node from nodejs.org, checks it againstSHASUMS256.txt, installs it into~/.local/share/dragon/node-v<ver>-<platform>(atomic rename, skipped when already there), installs pnpm into that prefix, verifies both versions, then runspnpm install --frozen-lockfileandpnpm setup:git. It appends the Node bin dir toCLAUDE_ENV_FILEso later Bash commands use it. Only the one summary line goes to stdout (a hook's stdout reaches Claude's context); install output goes to stderr. pnpm installs withnpm install --global --prefix "$NODE_HOME"; curl uses--retry-connrefused.set -euo pipefail; every failure names its cause.--print-versionsprints the two pins (used by the test)..claude/settings.json(new; no project settings existed): aSessionStarthook with no matcher (every source: startup, resume, clear, compact, fork, since compaction dropsCLAUDE_ENV_FILEexports), runningbash "$CLAUDE_PROJECT_DIR"/scripts/cloud-setup.shwith a 900 s timeout.pnpm setup:gitnow also runsgit config rerere.enabled false, matching the landing driver's merges; a fresh clone has no rerere cache.scripts/floor-merge.tsexportsSETUP_GIT_CONFIG(rerere off, thenMERGE_DRIVERS); the landing driver'sprepareWorktreesets it, andfloor-merge.test.ts"pnpm setup:git sets exactly the git config the landing driver sets" compares setup:git to it. Reason for that test change: it pinned setup:git to exactlyMERGE_DRIVERS, so the new rerere line failed it; it still demands exact equality, now with the landing driver's full list, so it is not loosened.Item 4, no silent native passes
DRAGON_REQUIRE_NATIVE(packages/translate/src/native.ts,requireNative):1is on; unset, empty or0is off; any other value throws. With it on,runTarget(check.ts) throwsDRAGON_REQUIRE_NATIVE=1 and native:<target> has no toolchain: <tool> (<reason>)instead of returningblocked (owner tooling);runHostLane(parity lanes.ts) throws likewise. That matches CI's "No native run was blocked (owner tooling)" step, which fails any run whose describe() lines say blocked or name a missing toolchain.runTargetandrunHostLanetake an explicitrequire/requireNativeso the tests that prove the blocked path (must-fix, lanes) keep proving it whatever the environment says.export DRAGON_REQUIRE_NATIVE=1toCLAUDE_ENV_FILEfirst (before reading pins, so it holds even if setup fails), and fails ifCLAUDE_ENV_FILEis unset (PM ruling on review of 892a687). Cloud sessions have no Swift or Kotlin, so a lane that runs a native file there fails loudly and must use CI (test-files.yml, separate PR).DRAGON_REQUIRE_NATIVE=1that early return now fails. Stricter only; no tolerance, check or test was loosened or removed.Tests added
packages/translate/test/require-native.test.ts: env parsing; env1plus a missing JDK/kotlinc (injected lookup) or a missing swiftc (PATH stubbed to an empty dir) throws naming the tool; env unset keepsblocked (owner tooling)with no suites on both targets; a bad value fails rather than reading as off.packages/parity/test/lanes.test.ts:runHostLanewithrequireNative: true, or env1, rejects naming the missing Kotlin toolchain; env unset stays blocked.packages/parity/test/cloud-setup.test.ts:--print-versionsequals the repo's workflow pins and packageManager; a no-op (exit 0, no output, nothing written to HOME) for CLAUDE_CODE_REMOTE unset, empty,false,1,TRUE; fails naming the cause for differing full pins (one in a.yaml), a mismatched major, an expression pin, no full pin, a non-pnpm or non-semver packageManager, both with--print-versionsand in a cloud session; accepts a+sha512suffix; rejects unknown arguments; pins the hook entry and the rerere line of setup:git.Linux path proven in CI
ci.yml'schecksjob now runs onubuntu-24.04(x86_64, the cloud image) and, before setup-node, runsCLAUDE_CODE_REMOTE=true CLAUDE_ENV_FILE=$RUNNER_TEMP/env scripts/cloud-setup.shtwice. Each round sources the env file and checksnode -vis the pin,pnpm --versionis the pin,DRAGON_REQUIRE_NATIVE=1is exported, stdout is one line, andpnpm typecheckpasses; the first round must install Node and the second must install nothing. Passing run at 579bce9: https://github.com/compiled-run/dragoncss/actions/runs/37736147076/job/113176001692What passed (macOS, local)
pnpm typecheck;cloud-setup.test.ts(7 tests, now also: the cloud run exportsDRAGON_REQUIRE_NATIVE=1even when a pin fails, fails withoutCLAUDE_ENV_FILE, hook has no matcher) andpr-review.test.ts: 2 files, 59 tests;actionlinton ci.yml clean;shellcheckclean.pnpm typecheck; ci.yml's suites (vitest run packages/layout packages/dragon: 109 files, 2527 tests; chrome-ports, parity registry-claims, api-floor, floor-merge, macroscope-ignore: 5 files, 51 tests); floor-merge, sorted-merge, land, cloud-setup tests: 4 files, 129 tests.pnpm typecheckvitest run packages/translate/test(all 37 files, including native-swift/kotlin, native-dpr-, every planted- file, must-fix, require-native) pluspackages/parity/test/lanes.test.ts,lanes-host-errors.test.ts,chrome-ports.test.ts,packages/parity/test/registry-claims.test.ts,packages/dragon/test/registry-claims.test.ts,cloud-setup.test.ts: 37 files, 481 tests passed (cloud-setup.test.ts re-run after its last edit: 6/6).DRAGON_REQUIRE_NATIVE=1exported:test-shards.test.ts,require-native.test.ts,lanes.test.ts,must-fix.test.ts: 4 files, 344 tests passed.shellcheck scripts/cloud-setup.shclean.pnpm testwas not run (targeted per task). The Linux install path of cloud-setup.sh (download, checksum, pnpm install) was not executed here (no Linux host or Docker locally); the first cloud session exercises it, and it fails loudly on any step.🤖 Generated with Claude Code