Repository navigation
Conversation
…y-data hash and extraneous script witnesses
ADR-0024 Q4 (M1): the four phase-1 rules the in-memory ledger did not check, under the node's error names
(OutputTooBigUTxO, WrongNetwork / WrongNetworkWithdrawal / WrongNetworkInTxBody, MissingTxBodyMetadataHash /
MissingTxMetadata / ConflictingMetadataHash, ExtraneousScriptWitnessesUTXOW); a networkId option (default 0).
For the playground's read adapter (D4): each transaction's inclusion slot (awaitTx resolves to { slot },
inclusion(hash)), script(hash) with the reference script's language, and the attack suite switchable at run
time (attacksEnabled, Q7). ledgerTx gains each output's encoded value size and the auxiliary data's bytes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n shapes (dev-host protocol 1, D13) ADR-0024 D7, F14: before signing a dev host's publish result, a page recognises exactly one of the protocol's publication shapes (referenceScript, stakeRegistration, verifier) against anchors it derives itself, with the fee cap, the window, wallet-only inputs and the exact registration deposit. Its own CBOR reader keeps the body slice and the holder output's encoded length. All 59 publication vectors in fixtures/host/verifier agree with the reference checker (11 accepted, 48 refused with their codes and check ids). Chain answers are trusted (#169). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A browser playground for every contract an npm project builds, Java or .jsc, as a client of the dev host: - the server (src/playground): launches the project's npm dev host over stdio (framing, reverse reads, a hard deadline, the npm fingerprint) and answers its chain reads from a memoryLedger (offline: settlementSlots 0, confirmed at the inclusion slot); at most four sessions, each its own ledger and host; a rebuild makes a session stale (it prepares nothing); reset is a new ledger and host. 127.0.0.1 only, a per-run token in the URL fragment, Host/Origin/Sec-Fetch-Site checks, no CORS, bounded JSON, a strict CSP. - the page (playground/): identities whose keys stay in the page, forms from the description's schemas (D6's table; anything else UNSUPPORTED with its path), and the call flow: prepare, the page verifier (verifyPrepared, verifyPublication for prerequisites), review, sign, submit, history with the attack suite's results, time and reset, and what offline success means. - joust playground [--port] [--accept-abi] [--accept-lock] [--no-open]: builds through the ABI and lock gates. Tests: I1, I3, I5, I6, I8, I9, I10, the read adapter, stage-tagged refusals, and the Counter walkthrough in Chromium for a Java and a .jsc Counter (CI installs Chromium for it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd assets, serial session lifecycle, no token in logs or argv, applied transactions recorded before settlement, reference-provided witness scripts extraneous - server: routes and page assets are looked up as own properties only (an inherited name reached res.end as a callback and could stop the server); session create, end and reset run one at a time, so the bound of four holds and no two sessions take over one ledger; sessions finishing after close() are closed. - index: the browser opens a private 0600 launcher file that forwards to the tokenised URL; the token is printed only with --no-open or when no browser opens. - session: a ledger-applied transaction is recorded before the host's settlement, so a failed settlement cannot hide it; a registered() read for the publication checks. - page: stakeSelf contracts' base address; the ledger's registration answer instead of 'unknown'; a reload no longer ends a session named by copied sessionStorage. - memoryLedger: a witness script that a spending or reference input already provides is extraneous (Conway). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…host says so, now as sent, tips on failed reads, the page prebuilt in releases - session: a contract is served only with served:true (a params contract arrives with served absent); prepare/publish return the now the host was sent; a failed ledger read carries the tip (the protocol requires one on every result). - page.js: a relative outDir is the caller's, not the page root's. - release: @julclang/joust ships playground/dist, built from this commit (ADR-0024 D6). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-host result in JavaScript (the conformance kit's reference checker) A dev-host client in a browser decides a host's prepare or publish result before signing exactly as the kit's ReferenceChecker (CallRules, KeyedRules, Ledger, Cbor) does: the body's plan and the host's claims, classification from the description, envelope, signers, fee cap, collateral, certificates, withdrawals, the call's redeemers and outputs (output-verifier claims included), keyed list roles and re-encodings, and publications. Input and output have the verifier vectors' shape; it never throws (an unreadable input is malformed) and reports what a review shows from the body (plan, the wallet's net outflow, signers, the created id). Every one of the 333 vectors in fixtures/host/verifier is decided: 302 with exactly the reference's problem codes (46 positives, 256 negatives), and the 31 calls that touch a MerkleMap field refused as notVerifiable (map claims' proofs are not checked here: fail closed). verifyPrepared is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…epts, and reviews what the body says (ADR-0024 I2) - check.js: the page's anchors (from the pinned build) and its pre-sign check of calls and publications through verifyHostResult, as plain functions; the page verifier and verifyPublication still run besides (either refusing refuses). - The review is built from the checker's report: fee, the signer's net outflow (deposits included), validity window, signers and outputs from the body; the created instance from the body's seed, not the host's claim. - Change must return to the payer's exact address (the reference's walletOutput/change): a base-address identity no longer accepts change stranded at its enterprise address. - A reservation is released on every way out before submission (a refusal, a decline, a check or signature that throws). - Keyed contracts are disabled (designated inputs arrive with M4); calls taking assets get an asset-offer control (pay.assets in canonical order). - Instances listed across every page of the listing; the contract address shown; host errors' kind and retryAtSlot in the history. - Test: a real host's publications, init and increment accepted through check.js, and tampered results (txHash, signers, plan, window, request, fee cap, anchors, an altered body) refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ies' secrets; I3 counts the processes a session starts - I1: the page's 32-byte random draws give each identity's mnemonic, entropy and payment key; none is in the server's log or in a heap snapshot of its process (searched with grep -F: the snapshot is larger than a string can be). - I3: the only process an offline session starts is its dev host (session.hostPid). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…page, map contracts shown unsupported, failed submits released, wallet gains shown - server: a top-level document navigation to the page is allowed cross-site (the command's file:// launcher is a cross-site initiator, so the default command landed on a 403); /api/ stays same-origin only. Chromium test through writeLauncher. - index: writeLauncher (exported, tested); the launcher lives ten minutes; a hint to use --no-open when a sandboxed browser cannot read it. - page: MerkleMap contracts are detected from the description's definitions and shown unsupported up front; a failed submit releases the reservation; the review says what the signer pays and what comes back (a negative net no longer renders as -1.-500000 ADA). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r2 · head e51007f Rounds 1 and 2 of the review are addressed. The reviewers were Codex, a design/correctness reviewer and a security reviewer. The design reviewer approved round 2; Codex and security re-reviews are running.
Deferred (P3): Local tests: playground 22/22, js/joust host/conformance/ledger/cli 162/162, state-client 665/665. |
…uLC decoder, constructor indices exactly, addresses as received; reports the state before and after (#174 review r3) - Datum and redeemer payloads go through the CBOR rules of Plutus decodeData that julc-core 0.1.0-pre22 applies (MapPreservingCborDecoder): byte strings, bignum payloads included, definite of at most 64 bytes or chunked so; no text, floats or simple values; tags 2/3 only as c2/c3 around bytes; constructors 121-127, 1280-1400 or 102. Exported as plutusData. Paired cases: each one's verdict under the pinned decoder (run on the same hex) is the test's expectation. - A general constructor index beyond Number.MAX_SAFE_INTEGER fails closed (the data model keeps a Number, so distinct indices could compare equal; JuLC accepts them). - An output address must round-trip to its received bytes (the SDK drops a pointer address's trailing bytes and re-encodes another address): malformed otherwise. - The report adds before (the target output's datum, decoded), after (the body's checked continuation) and removed (a destroy). All 333 verifier vectors decide as before (302 exactly as the reference, 31 map calls refused). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…token in a file or log), the review's states from the chain and the body, lost submit answers reconciled (#174) - Pairing (D8): the session token lives in memory only. The link the command opens (through the 0600 launcher file) or prints (--no-open, or no browser could be asked) carries a single-use pairing code (24 random bytes, ten minutes); the page POSTs it to /pair (same Host, Origin and site rules, JSON only) and gets the token once; the code is then spent and the launcher file removed. A spent or expired code pairs nothing; a paired tab keeps working across reloads (sessionStorage). - Review: before from the chain's target output, after from the body's checked continuation (removed for a destroy, none before a creation); the host's prediction folded apart as unchecked and not used to decide. - A submit whose answer is lost (a transport failure) is looked up in the session's history: confirmed if there, else shown as outcome unknown, and never released. - Tests: the pairing matrix (Host, Origin, site, content type, GET, reuse, made-up codes, the token as a code, expiry), the launcher file holds no token and pairs once (a reload keeps the tab, the same link elsewhere does not pair), no log line carries the token; in Chromium a false host prediction (the review shows count 7 to 8 from the body), an answer lost after the ledger applied it (reconciled confirmed) and a request lost (outcome unknown, nothing failed at stage ledger). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r3 · head 1847dbc Codex's round-2 findings. The design and security reviewers approved round 2.
Local results: state-client 669/669 (all 333 vectors decided as before), playground 23/23. ADR-0024 D8 still describes the token in the URL fragment; #159 gets a matching revision. |
…; keyed calls report the object's value before and after (#174 review r4) - pdata: a general constructor's [index, fields] may be an indefinite array of exactly two elements and its break (julc-core 0.1.0-pre22 decodes it; one, three or a missing break are refused). The JuLC comparison cases cover all five forms. - verifyHostResult's report for keyed calls: before and after from what the keyed rules decoded (the target node's value, the continuation's; a creation's state; a retired object's retired record), and removed for a removal. Shapes asserted on the keyed creation, insert, update, retire and removal fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…irs and calls its API relative to its base (#174 review r4) - An "outcome unknown" history entry keeps its session and transaction hash and offers a recheck, which reads that session's history and updates the entry in place. Test: the answer is lost after the ledger applied it and every history read fails (unknown); a later recheck confirms it (the same entry, count 10). - The page fetches 'pair' and 'api/<route>' relative to its location, so a page mounted under a base (joust dev's /playground/) pairs and calls there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r4 · head 4af1b89 Codex's round-3 findings. The security reviewer approved round 3; the design reviewer approved round 2.
Local results: state-client 670/670, playground 23/23. This is round 4. From here, P2s that the security reviewer judges not security-relevant become follow-up issues. |
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…round-m3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # js/joust/playground/main.js
… indices beyond 2^53 - 1 (#174 review r5) decodeData (behind dataEqual and verifyPrepared) keeps a constructor index as a Number: a tag-102 index it cannot hold exactly, definite or indefinite pair, is now refused before conversion instead of rounded, so two distinct indices never compare equal. The test decodes both encodings at 2^53, 2^53 + 1 and 2^64 - 1 (refused) and 2^53 - 1 (kept) through decodeData and the checker's plutusData; it replaces the test that showed the lossy comparison. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…id not take, as an immediate one does (#174 review r5) One function tells a confirmation (its slot, a settlement the dev host did not take, attacks the scripts accepted), for the immediate path and the recheck. The walkthrough's recheck reads a history entry that carries a settlement error and asserts the same "start a new session" warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r5 · head acc0863 Codex's round-4 findings:
Local results: state-client 670/670, playground 23/23. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… build's contracts, no stray "null" text, a prepare without a body refused cleanly (#174) - FF1: startSession and reset redraw the contract list; a contract the new build no longer serves is deselected. Chromium test: rebuild with a second contract, "keep the ledger", the new contract is listed. - FF2: banner, instances and review drop null children (replaceChildren(null) showed "null"). - FF5: the attack-suite toggle runs under guard and redraws from the session; host sites are rendered only when an array; dead sessionStorage writes removed. - FO1: a prepare answer without a prepared body fails at stage host instead of a TypeError in the cleanup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rise address, where the host pays its key hash (#174 final pass) The dev host pays a key hash, and takes a payer's inputs, at the key's enterprise address on the session network (protocol 1). The page funded, prepared from, read balances of and checked wallets at the identities' base addresses, so a payout to an identity's key hash (an escrow released to Bob) never reached its balance or its next call. Each identity's funding, payer, balance and wallet address is now enterpriseAddress({ type: 'key', hash: keyHash }, 0); the dev wallet still signs with that payment key. The identities list carries each identity's key hash and balance as data attributes. Test: in Chromium, Alice opens a 600 ADA escrow for Bob and releases it; Bob's balance rises by the 600 ADA and he opens a 1,200 ADA escrow (more than his own 1,000), which spends the payout. It fails with base-address identities. I1's secret search finds the identities by their enterprise addresses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: final pass · head 557f808 The final pass covered the whole branch at acc0863, with three reviewers:
Follow-up issues: an "others receive" line in the review (FO2), and asking before a paired tab's reload starts a session (FF4). Local results: state-client 670/670, playground 26/26. |
…ies) into feat/playground-m2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…174 final confirm) 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 fbb4d10 Codex's confirm of the final-pass fixes found one P2: a malformed prepare answer left the instance locked. It is fixed in Status of #174:
Follow-up issues will be filed for the deferred P2/P3 items. Merging is the maintainer's call. |
…ies) into feat/playground-m3 - main.js: imports merged; the new session's contract refresh (round final pass) and the DevKit session notes both kept; the banner's fill() with the DevKit banner beside it. - DevKit test identities follow the final pass too: their address is their payment key's enterprise address (where the host pays and spends their key hash), and the faucet tops that address up; a CIP-30 wallet keeps its change address as the payer. - playground.test.js: the escrow payout walkthrough and the D3/I10/I4 tests both kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t/playground-m3 Conflict-free. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
Summary
ADR-0024 milestone M1:
joust playgroundfor npm projects, offline. A browser page for every contract the project builds, Java or.jsc, with no page or client code. It is built as a client of the ADR-0022 dev host: the playground server launches the project's npm host over stdio, answers its chain reads from amemoryLedger, and submits. The page renders what the host describes, checks every body with the page verifier, and signs in the page.Stacked on #160 (
feat/dev-host-m3-maps, the top of the dev-host stack). The design is ADR-0024, PR #159 (r2, the maintainer's Q1–Q7 answers). Commits:memoryLedger: the four F3 rules (Q4), plus the inclusion slot, the script language and the attack toggle the read adapter needs.verifyPublicationin state-client: the page verifier's publication shapes (D7, F14).What M1 adds
resetis not used.src/playground/host.js,session.jsjoust playground [--port] [--accept-abi] [--accept-lock] [--no-open]. Builds through the ABI and lock gates and never accepts without its flag. Offline only.--mode devkit/--networkare refused until M3.src/playground/index.js,bin/joust.jsutxos,output,tip,protocolParams,script(with language),stakeRegistration,assetHistory. Map-history reads (redeemers,datum) areunsupportedoffline.settlementSlots: 0; each transaction is confirmed at its inclusion slot. A ledger refusal is settleddiscarded, so its inputs are free again: the ledger will never apply that body.session.jsdevWallets with fresh mnemonics, held in page memory only. The server learns addresses and funds them with 1,000 ADA each.playground/main.jsunsupported: viewson npm).playground/form.jsverifyPreparedfor calls andverifyPublicationfor prerequisites. Anchors (policy, address, description) come from the session's pinnedcontracts.jsonbytes, not the host, and are cross-checked againstdeployment. A declined review isdiscarded.main.js127.0.0.1only. A per-run 32-byte token goes in the URL fragment, thensessionStorageand a header.Host,OriginandSec-Fetch-Siteare checked; no CORS;OPTIONSis refused. Bodies are bounded JSON and validated per field. CSPdefault-src 'self'. Text-only rendering.server.jsNotModelledrefusal shows as "not modelled offline: try DevKit". The attack suite is on by default with a toggle; each transaction's attack count and any accepted attacks appear in the history and the log.main.jsmemoryLedgeraddsOutputTooBigUTxO,WrongNetwork/WrongNetworkWithdrawal/WrongNetworkInTxBody,MissingTxBodyMetadataHash/MissingTxMetadata/ConflictingMetadataHashandExtraneousScriptWitnessesUTXOW, plus anetworkIdoption (default 0).js/joust/src/test/offline.jsThe page is one static bundle. A release may prebuild it into
playground/dist/(gitignored); from a checkout it is built in memory with Vite in about 2 s, and nothing is written into the project.Not in M1 (by the ADR's milestones)
/playgroundonjoust dev, Connect wallet through the Cardano Foundation connector, journal and settlement (M3).@Quorumco-signing (M4).Points for review
discardedfor bodies declined before handout or keyed attempts the node rejected. Offline, a refused body can never land (the playground never resubmits it), so the server discards it to free its inputs. The host accepts this.verifyPreparedstill has the gaps the conformance test lists (pageGaps). The playground signs only whatverifyPreparedaccepts and the D13 subset it implements; closing those gaps is Page verifier (js/state-client) is weaker than the dev-host reference checker in 19 cases #162's work, not M1's.verifyPreparedoffline. Offline time is the ledger's slot, which time advances move, not the wall clock. The page checks windows against the session'snow, which comes from the trusted chain (Investigate a trustless-provider mode for browser-only dApps #169).verifyPublicationchecks are stricter than the reference checker: any witness script, and any witness datum or script data hash, on a publication is refused.Test plan
js/joust/test/playground.test.js, 16/16 locally:fetchand sockets stubbed, launching only its host.prepareandpublishstale; a new session gets a new fingerprint and can keep the ledger.require, Bob's@OnlyOwner, a wrong signature refused by the ledger and then discarded, an unknown reservation.Host, foreignOrigin,Sec-Fetch-Site: cross-siteandtext/plainposts. No session is started and the clock does not move..jscinterface fails without--accept-abi, and the manifest is unchanged; the project tree is hashed before and after a session..jscCounter: create as Alice (publication + init), increment as Alice, refused as Bob, a declined review, advance time, reset.offline-ledger.test.js25/25 (was 18) andlibraries.test.js7/7.host-publication.test.js.host-conformance.test.js+host.test.js124/124;cli.test.js13/13.JOUST_REQUIRE_CHROMIUM=1: a missing browser fails rather than skips) before the no-skip check.🤖 Generated with Claude Code