Skip to content

docs(adr): ADR-0024 a dev playground over the dev host (proposed) - #159

Open
satran004 wants to merge 5 commits into
mainfrom
docs/adr-0024-playground
Open

satran004 wants to merge 5 commits into
mainfrom
docs/adr-0024-playground

Conversation

@satran004

Copy link
Copy Markdown
Member

Summary

Issue #155 asks for a browser playground: one generated UI for Java and .jsc contracts in npm and Gradle projects, running offline (an in-memory ledger) or on Yaci DevKit with test identities and CIP-30 wallets (Yano first). This ADR designs it as a client of ADR-0022's dev host (#142): the playground server launches the project's own host over stdio, answers its chain reads from memoryLedger (offline) or the network's provider (DevKit), and submits; the page renders describe, signs, and checks every body first. Status: Proposed.

Docs-only. This PR adds docs/adr/0024-dev-playground.md. No implementation, test or build files change. Accepting it is design acceptance only. Implementation waits for ADR-0022 M1c and M2 (#153, #154) on main.

Decisions

ID Risk Proposes
D1 medium The playground is a dev-host client; it never builds a transaction itself
D2 low Sessions (mode, chain, build, host), at most four; rebuild marks a session stale; offline reset = new ledger and host
D3 low joust playground (offline by default), /playground on joust dev (DevKit), native joust playground for Gradle; ABI/lock gates untouched
D4 medium One read adapter, two chains: memoryLedger (+ inclusion slot, script language) or the DevKit provider; mainnet impossible
D5 medium No key ever reaches the server: offline identities and DevKit test identities live in the page; CIP-30 (Yano) with network checks
D6 low One static page driven by describe; a form type table; anything else UNSUPPORTED, never guessed
D7 medium Call flow with typed failure stages; page-side D13 checks, adding publication shapes to the page verifier; never "confirmed" before inclusion
D8 medium Loopback only, per-start session token, Host/Origin checks, no CORS, text-only rendering, CSP
D9 low The UI states what offline success means and what the ledger does not model or check; accepted attacks shown
D10 low Scenario export/import with identity labels only (no keys, no tx bytes)
D11 low Supports exactly what the host serves; widens as host milestones land

Points needing a maintainer decision

  1. Node in Gradle projects (Q1). Options: (a) the native joust runs a @julclang/joust of its own version from a JOUST-owned cache, integrity-checked; (b) resolve the npm package as a Maven artifact; (c) port the server and ledger to Java. Lean: (a). §10.
  2. Command shape (Q2). The issue proposes joust dev --playground. Lean: joust playground for offline, /playground on joust dev for its network. §10.
  3. Public testnets (Q3). Lean: not in v1. §10.
  4. memoryLedger's unchecked rules (Q4): output value size, network ids, auxiliary-data hash, extraneous script witnesses. Lean: add them in M1. §10.
  5. Yano (Q5) as a third mode / differential check. Lean: a follow-up issue after M3. §10.
  6. Where DevKit's journal lives (Q6). Lean: a per-user state directory, so the playground writes nothing into the project. §10.
  7. Attack suite offline (Q7). Lean: on by default with a toggle. §10.
  8. The issue's Gradle "common bundle" is replaced, not built: the JVM host runs the verified snapshot of the project's own build (§5, §11). Please confirm this departure from the issue.

Related findings (out of scope)

  • joust dev sends access-control-allow-origin: * on every route (js/joust/src/dev.js:152), including POST /dev/topup and the chain proxy: any website can use them while it runs. Worth its own issue.
  • memoryLedger does not check the rules in Q4 today, which affects joust test users too.
  • The JVM host on Windows relies on detection rather than diversion (ADR-0022 Q6), and CI runs the hosts on Linux only.

Test plan

🤖 Generated with Claude Code

satran004 and others added 2 commits November 21, 2026 11:31
Issue #155: one generated UI for Java and .jsc contracts in npm and Gradle
projects, offline on memoryLedger and on Yaci DevKit with CIP-30 wallets,
designed as a client of ADR-0022's dev host. Design only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Q1 native joust runs its own version's server from a per-user cache; Q2 joust
playground everywhere; Q3 no public testnets in v1, Connect wallet through the
Cardano Foundation connector with Yano first; Q4 add the unchecked ledger rules
in M1; Q5 Yano later; Q6 per-user journal keyed by DevKit's startTime; Q7
attacks on by default. Adds F18 (the connector) and F19 (DevKit identity).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@satran004

Copy link
Copy Markdown
Member Author

Author reply: round r2 · head 13f5319

Records the maintainer's answers to the points in the PR body. Docs-only, one file.

Point Decision Where
Q1 Node in Gradle (a): the native joust runs a @julclang/joust of its own version from a per-user cache (~/.joust/playground/<version>), integrity-checked; Node 22+ required D3, §6, M2, §10
Q2 Command joust playground in npm and Gradle projects; /playground on joust dev D3, §10, §11
Q3 Public testnets Not in v1. On DevKit, Connect wallet uses the Cardano Foundation connector (cardano-connect-with-wallet-core 0.2.12, already used by the dApp and the template) with Yano first D5, F18, M3, §10
Q4 Unchecked ledger rules (a): added to memoryLedger in M1 D9, §6, M1, §10
Q5 Yano Later, separately §10
Q6 Journal (b): per-user JOUST state directory, keyed by project and chain, the chain key including DevKit's genesis startTime (so a reset DevKit starts an empty journal) D4, F19, M3, §10
Q7 Attacks offline On by default, session toggle D9, §10

Still open: point 8, replacing the issue's Gradle "common bundle" with the host's verified snapshot (§5, §11).

🤖 Generated with Claude Code

…d (pairing, the page's reference check, DevKit identity and settlement)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@satran004

Copy link
Copy Markdown
Member Author

Author reply: round r3 · head f9b5a25

ADR-0024 r3 brings the design text in line with what the M1–M3 implementation and its reviews changed (#174, #178, #179). Docs-only, one file.

Change Section
One-time pairing. Every link carries a single-use code, the page exchanges it once for the session token, and the launcher file holds no token. Cross-site top-level navigation is allowed to the page's own files only D8
verifyHostResult (a port of the reference checker) runs beside verifyPrepared: either one refusing means no signature. The review comes from the body D7 steps 3–4
DevKit mode is Yaci Store only (Ogmios has no inclusion slots), and the provider's genesis must equal the admin identity. Settlement comes from the chain, the wallet handoff is journaled, the faucet is admin-only, and the TTL is capped D4
Implementation notes: session limits, the Gradle trust rules, the Connect-wallet payer §13 (new)
The Gradle "common bundle" replacement is taken as accepted with the M2 go-ahead §10

satran004 and others added 2 commits November 24, 2026 10:24
…r (§2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed as ./gradlew build trusts them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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