Repository navigation
Conversation
…st (ADR-0024 M2) The playground's client side of the JVM host's launch (dev-host protocol 1, "Launch and framing"): - `joust playground` in a Gradle project runs `./gradlew build joustHostSpec` through the build's own wrapper (its gates: checkJscAbi, the lock check); --accept-abi/--accept-lock are refused there (I10). - build/joust/host-spec.json is validated strictly; every launch entry is copied into a private, read-only snapshot (regular files only, opened with O_NOFOLLOW|O_NONBLOCK, no link on the way), each file's hash and the digest are checked against the copied bytes, jars with a manifest Class-Path are refused, and the JDK is launched on the snapshot with exactly the protocol's arguments and environment allow-list. The snapshot is deleted when the host exits. - The page's anchors (descriptions, compiled scripts) are read from the same snapshot, sibling jars included (a small jar reader), as the host reads them: the first description in class-path order, the script from beside its validator class only (refused when that entry holds another class of the same simple name). - I6: a session is stale once the launch entries or the spec change; the next session runs the build again first. - Sessions take a build source (npmSource, gradleSource); the server and session are otherwise unchanged. - Named views run in the page when the host advertises `views` (the JVM host); on npm the page says they are not available. - The npm joust runs `playground` in a Gradle build (the native joust's cached package does). Tests (playground-gradle.test.js): the spec, snapshot, links, FIFO, Class-Path, digest and script rules; the exact launch; I6 with a fake build; and, with a staged repository and a joust CLI, the Counter walkthrough in Java and .jsc Gradle projects compared step by step with the npm walkthroughs (I11), a real rebuild during a session (I6), the .jsc ABI gate (I10), and the native joust's playground end to end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f this joust's own version (ADR-0024 Q1) The native joust gains `playground` in a Gradle build. It runs the npm package @julclang/joust of its own version, never the project's, from ~/.joust/playground/<version> (JOUST_PLAYGROUND_HOME moves it), in the nearest Gradle project directory; the package then runs ./gradlew build joustHostSpec and the JVM dev host. - Node.js 22+ is a checked prerequisite (node --version), npm too. - The cache is installed once by npm into a private temporary directory beside it (its own package.json, so no project or ancestor .npmrc applies; --ignore-scripts, --workspaces=false, --save-exact), then renamed into place atomically; a concurrent install that won is used, a failed one leaves nothing. npm checks the registry tarball against its published integrity and records it in the cache's package-lock.json; the installed version must be this joust's. - A development build has no package of its version on npm: it is refused unless JOUST_PLAYGROUND_TARBALLS names local tarballs (tests and CI). - Scaffold's npm invocation (its JavaScript entry point by our node) is shared as npmCommand. Tests: PlaygroundTest (install once then the cached package in the project; a subdirectory; Node missing, old or unreadable; a development build; tarball paths; another version; a failed install; a concurrent install; help), and a real npm install of a local tarball with its integrity recorded. The Java quick start documents the command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ge prebuilt (ADR-0024 M2, Q1) - js/joust/scripts/build-playground.mjs builds the page into js/joust/playground/dist/, which the package ships: the native joust's per-user cache has no Vite, so a published @julclang/joust without the page could not serve it. - release.yml builds it (setup-js's pinned dependencies) before the packages are prepared and published. - build.yml's cli job (the native joust, JDK 25, Node 22, the staged repository, this commit's engines) gains "Test the Gradle playground": the page built, this commit's npm tarballs packed, Playwright's Chromium installed, and test/playground-gradle.test.js run with JOUST_REQUIRE_GRADLE and JOUST_REQUIRE_CHROMIUM, then checked for skipped cases. The job's timeout goes from 60 to 90 minutes (four Gradle builds and five browser walkthroughs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: server.js (the serial session lifecycle with M2's build source), index.js (the token-free browser launch shared by the npm and Gradle paths), release.yml (one page-build step: M2's build-playground.mjs, before the versions are rewritten). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict: index.js (writeLauncher with M2's Gradle path and the shared announce). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, exact freshness, hardened jars (#178) Codex P1/P2 and the security and design reviews of #178, each with a regression test (playground-gradle.test.js): - P1-1 The wrapper is found as the native joust's Locator.gradleBuildRoot finds it (project.js gradleBuildRoot): the nearest settings file, walking only through trusted directories (this user's, or JOUST_SAFE_DIRS), never to the filesystem root; else the project's own wrapper. - P1-2 The spec's java must be a JDK's bin/java (bin/java.exe) whose release file declares Java 25+ (ADR-0022 D3), launched by its real path; checked before anything is copied. - P1-4 Windows: a wrapper path holding a cmd.exe metacharacter (& ^ % ( ) ! " < > |) is refused. - P1-5 Freshness is decided against the exact spec bytes and manifest the copy was verified against, checked again after the copy: a build that changed between the reads is copied again (the old copy discarded), so a session never runs one build while reporting another as current. - P2 I6 compares contents, not size and time: every launch directory's inventory and file hashes, the build's own jars hashed, dependency jars (Gradle's cache) by their file identity at the copy. - P2 The spec is read once, as a bounded, non-blocking, no-follow regular file (a FIFO there is refused at launch and stale for a session). - P2 Manifests are found case-insensitively; a second manifest or a repeated attribute is refused. - P2 A snapshot directory or class-path entry holding the class-path delimiter is refused. - P2/G1 A Gradle project is classified as bin/joust.js does (npm only with joust.config.json or a @julclang/joust dependency): an unrelated package.json no longer sends it the npm way. - P2 A Multi-Release jar that versions a validator class or a JOUST resource is refused (not resolved per JDK). - G-S4 The zip's end record must end the file and the central directory end where it starts. - G-S5 This user's snapshots a day old whose playground is gone (owner.pid) are swept at start, unlocked first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…omplete for the install wanted (#178) Codex P1-3 and the security and design reviews of #178: - A cache directory (and its home) is used only when it is this user's (its owner), private (no group or other access), not a link, its .complete names exactly the install wanted, and bin/joust.js resolves inside it: before a cache hit and before accepting a concurrent install that won the rename. A directory that fails is refused with the reason, never installed over. - G-S1 JOUST_PLAYGROUND_TARBALLS needs JOUST_PLAYGROUND_HOME: tarballs never fill the real per-user cache. - G3 Tarball installs are keyed by the tarballs' SHA-256 too: a rebuilt tarball is installed again. - G-S5 Install directories an interrupted install left are swept after a day. Tests (PlaygroundTest): a hit refused when group-writable, another user's, for another version, or with bin/joust.js linked out; a linked cache and a foreign home; a world-writable concurrent winner; tarballs without their own cache, a same tarball's hit, a rebuilt tarball reinstalled; the sweep. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r1 · head 2c40977 Review round 1 is addressed. Codex and the design reviewer asked for changes; the security reviewer approved, with P3s.
Each change has a regression test. Local results: Follow-up issue: an |
…ory entries kept once, a linked cache home refused before any chmod (#178) - jar.js: a repeated directory entry (no content) is kept once; a repeated file name is still refused (real dependency jars repeat directories, e.g. archunit). - Playground.java: a linked cache home is refused before privateDir, whose chmod would follow the link to its target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…own, gated first session, hashed external jars (#178) Codex round 2 on #178, each with a regression test (playground-gradle.test.js): - P1-1 Gradle searches upwards for a settings file itself: the trusted build root must hold its own settings.gradle(.kts) (a regular file, not a link) before Gradle runs, else refused with what to add. - P1-4 The first session runs only the spec the gated startup build wrote (`build joustHostSpec`, its bytes captured right after it): a spec written since (a bare joustHostSpec, which skips checkJscAbi) makes the open build again. The gated baseline is carried through copy retries and later opens. - P2-1 The metadata-only freshness check is kept for modules in Gradle's immutable dependency cache (caches/modules-2/files-2.1/...) only; every other jar (the build's, local file dependencies, composite outputs) is hashed against the spec. - P2-2 jar.js: each central-directory record must lie within the directory, and exactly the declared number of records must fill it (the JDK recounts an understated count). - P2-3 The owner entry's count of classes of the validator's simple name is ValidatorScripts' raw count, META-INF/versions entries included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ew cache directories private from creation (#178) Codex round 2 on #178 (P1-2, P1-3), with tests (PlaygroundTest): - Every directory above the cache home, as written and as resolved (the default ~/.joust/playground and JOUST_PLAYGROUND_HOME alike), must be owned by this user or root and not writable by others unless sticky; checked before the install, on a cache hit and for a concurrent install's winner. - Missing cache directories (and each install directory) are created private (0700) at creation; an existing home is checked and never changed (no chmod): one others can read is refused and left as it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r2 · head c638345 Codex's round-2 findings, plus the round-2 P3s from the design and security reviewers (both approved round 2):
Each change has a regression test. Local results: Follow-up issue (design G2 / security G-S2): an |
One-time pairing from M1 (#174 round 3): the Gradle path announces itself through the same flow as npm (index.js announce(): the launcher file and printed links carry a single-use pairing code, the session token stays in memory), so no reusable token appears in Gradle mode either. startPlayground takes the build source and the pairing options; the Gradle tests open server.pairingUrl() and read the native joust's printed #pair= link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ay how to fix it (#178 G-S8) Still refused; the message names the directory and the fix (chmod go-w <dir>, or another JOUST_PLAYGROUND_HOME). A directory another account owns keeps the advice to choose another home. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es, checked before every run; the real module cache only (#178) Codex round 3 on #178, with tests (playground-gradle.test.js): - The settings file checked is the one Gradle takes: refused when both settings.gradle and settings.gradle.kts exist, or when it is not a regular file (Gradle follows a link). The build-root walk also skips a directory others can write (unless sticky or listed in JOUST_SAFE_DIRS): another account could plant a settings file there. - The build root and its settings are resolved and checked again right before every wrapper run, automatic rebuilds included: a settings file removed since (a branch switch) is refused and the wrapper never runs. - The identity-only freshness check is limited to Gradle's real module cache (GRADLE_USER_HOME or ~/.gradle, caches/modules-2/files-2.1, resolved); a cache-shaped directory elsewhere, inside the build especially, is hashed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cal path (#178) Codex round 3 on #178: the cache home's deepest existing ancestor is resolved to its real path once; that canonical path is what is checked (every directory above it this user's or root's, not writable by others unless sticky), created, installed into and given to node. A link hop in a directory another account controls can no longer make the checked cache and the one run differ. A linked home itself is still refused. Test: an alias through a link in a world-writable directory installs and runs under the canonical path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r3 · head 085803d Codex's round-3 findings. The design and security reviewers both approved round 3. This branch also merges #174's reviews r3 and r4: one-time pairing applies to the Gradle path too, with no reusable token in a file, log or argument.
Local results: |
…round-m3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # js/joust/playground/main.js
…ky exception, DCL settings, opener failures (#178) Codex round 4 on #178, with tests (playground-gradle.test.js): - The build root itself must pass the walk's trust (the walk falls back to the project it started in): a project others can write (0775) is refused unless listed in JOUST_SAFE_DIRS. - No sticky-bit exception in the settings walk: a sticky directory still lets another account create a settings file, so a group- or world-writable build directory needs JOUST_SAFE_DIRS (the npm cache's sticky rule is unchanged). - settings.gradle.dcl counts as Gradle 9 counts it: in the walk (a link counts, Gradle follows it) and in the candidate check (one candidate per directory, a regular file). - A browser opener that starts and then exits non-zero (xdg-open without a browser) falls back as a spawn error does: one fresh pairing link, unless the page paired meanwhile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex round 4 on #178: normalising drops a link followed by .., which the file system resolves to the link target's parent, so the cache would be checked in one directory and used in another. JOUST_PLAYGROUND_HOME with a .. component is refused before anything is resolved. Test: alias/../cache refused, nothing created. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r4 · head 8e699d5 Codex's round-4 findings:
Also merges #174 r5. Local results: |
…yours and writable by nobody else (#178) Codex round 5 on #178: for a build root not listed in JOUST_SAFE_DIRS, the settings file Gradle takes and gradlew must be owned by this user (or root) and not group- or other-writable; the refusal names the file and the fix (chmod go-w, or list the root). Test: a 0755 root with a 0664 settings file, then a 0775 gradlew; listed, accepted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r5 · head 448e5a9 Codex's round-5 findings:
Local results: |
…build, linked wrapper, ZIP64 locator (#178) The final reviews of #178 (Fable, Opus), each with a test (playground-gradle.test.js): - FG1 A linked gradlew is refused, as a linked settings file is. - FG2 Every path that lets another account change what Gradle runs (the directories walked from the project to the build root, the settings file, gradlew) is named in one refusal with one `chmod go-w <paths>` line (or JOUST_SAFE_DIRS for the root): a umask 002 system's `joust new` or `git clone` is fixed in one step. The walk now enters this user's directories whatever their mode and refuses afterwards, naming them. Documented in the Java quick start. - FG4 A walk that stops at a directory holding the settings file but not this user's names that directory (list it in JOUST_SAFE_DIRS if trusted) instead of asking for a settings file. - FG5 jar.js refuses a repeated name only for what the launch reads or the JVM loads (the manifest, META-INF/joust, plutus and versions entries, classes); other repeats keep their first copy. - FP1 A ZIP64 end locator before the end record is refused: the JDK always follows it, possibly to another central directory (fixture: the final reviewer's polyglot jar, test/fixtures/playground/zip64-poly.jar). - FP2 A compiled script whose JSON names cborHex more than once is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: final pass · head 8e6e657 The final pass ran Codex, a Fable reviewer and an Opus reviewer over the whole branch at 448e5a9. The Opus reviewer approved; the JVM side and the JS client agree. The Fable reviewer asked for one security fix. All fixes are in
FG3 (a rebuild that only adds a first launch directory) is a follow-up issue. This head also merges #174's final-pass fixes. Local results: |
…es below it (#178 FG6) Regression from 87ef72b: with the root listed in JOUST_SAFE_DIRS the directories walked from the project to the root went unchecked. Each walked directory that is not itself listed is checked again, whatever the root's listing; listing the root still exempts only the settings file and the wrapper. The refusal names the directories to list. Tests: a listed root with a 0777 subproject is refused (the reviewer's probe, case 4), accepted once the subproject is listed; the umask 002 case needs each writable directory listed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ies) into feat/playground-m2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply · head b6e96ab The Fable reviewer approved the final-pass fixes and found one regression from them (FG6). It is fixed in This head also merges #174's final-pass fix: identities use their enterprise address. Local results: |
…ord (#178) Codex's confirm of 87ef72b (P2): the refusal's `chmod go-w …` line single-quotes each pathname (an embedded quote closed, escaped and reopened), so a path with a space, $, ; or a quote is one argument when the line is pasted into a shell. Test: shellQuote round-trips such a name through sh -c; a build under "it's a $HOME; touch pwned" is fixed by running its printed line, and nothing else runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: review complete · head 718db28 Codex's confirm of the final-pass fixes:
Status of #178:
Merging is the maintainer's call. |
…feat/playground-m4 Conflicts: - devkit.js: M3's re-checked problemOf, with M4's keyed windowProblem in it; the session status carries M4's keyedLimits beside M3's fencedUntil. - main.js: M3's enterprise-address identities (with M4's labelled identities for replay; the separate enterprise-holdings line is gone, since the identity's address now is its enterprise address), fill and confirmedNotes in M4's approval and signing path, both session-start steps, the union of imports. The keyed operation records stay in the chain's journal beside M3's reservations, under the same lock and written before the call goes on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ADR-0024 M2:
joust playgroundin Gradle projects, over the JVM dev host. Stacked on #174 (M1); the base isfeat/playground-m1.What it adds
js/joust/src/playground/gradle.js,jar.js), per protocol 1 §Launch:build/joust/host-spec.jsonis validated strictly: protocol, absolutejava,mainClass, ordered entries and every hash.Class-Path.launchHost. A session takes a build source (npmSource/gradleSource).joust playgroundin a Gradle project:./gradlew build joustHostSpec, so the build's own ABI and lock gates apply.--accept-abiand--accept-lockare refused; accept a change with the Gradle tasks instead.joust playground(julc-state-cliPlayground.java, Q1):@julclang/joust@<its own version>once into~/.joust/playground/<version>, never from the project. npm checks the registry tarball's integrity and the lock file records it.JOUST_PLAYGROUND_TARBALLS(tests and CI only).views(JVM). On npm the page says they are not available.playground/dist, so the cached install (which has no Vite) can serve the page.js/joust/README.mdand the Java quick start.The branch also merges #174's review rounds 1 and 2 (the M1 fixes). That is why its diff touches M1 files; the conflicts are resolved in the merge commits.
Tests (local)
playground-gradle.test.js(staged Maven repo, native CLI, Chromium)playground.test.js(npm, M1)PlaygroundTest,JoustMainTest,ScaffoldTest)playground-gradle.test.jscovers:Class-Path, digest mismatch, the exact launch;joust newGradle project, in Java and in.jsc(Alice creates and increments, Bob is refused, the named viewcount, reset);.jsc× npm and Gradle) give the same step-by-step transcript;.jscABI gate (I10);Points for review
./gradlew build joustHostSpecfrom inside an HTTP request. The command is fixed, the token is required, and nothing comes from the request.🤖 Generated with Claude Code