Skip to content

feat(joust): joust playground, offline (ADR-0024 M1) - #174

Open
satran004 wants to merge 18 commits into
feat/dev-host-m3-mapsfrom
feat/playground-m1
Open

satran004 wants to merge 18 commits into
feat/dev-host-m3-mapsfrom
feat/playground-m1

Conversation

@satran004

Copy link
Copy Markdown
Member

Summary

ADR-0024 milestone M1: joust playground for 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 a memoryLedger, 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:

  1. memoryLedger: the four F3 rules (Q4), plus the inclusion slot, the script language and the attack toggle the read adapter needs.
  2. verifyPublication in state-client: the page verifier's publication shapes (D7, F14).
  3. The playground: server, page, command, tests, CI and docs.

What M1 adds

ADR What Where
D1, D2 Dev-host client: launch checks, npm fingerprint, framing, reverse reads, hard deadline. Sessions: each has its own ledger and host, at most four, least recently used ends first. A rebuild makes a session stale: it prepares and publishes nothing, and the page offers a new session that keeps or empties the ledger. Reset starts a new ledger and host; the protocol's own reset is not used. src/playground/host.js, session.js
D3 joust 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 / --network are refused until M3. src/playground/index.js, bin/joust.js
D4 Offline read adapter: utxos, output, tip, protocolParams, script (with language), stakeRegistration, assetHistory. Map-history reads (redeemers, datum) are unsupported offline. settlementSlots: 0; each transaction is confirmed at its inclusion slot. A ledger refusal is settled discarded, so its inputs are free again: the ledger will never apply that body. session.js
D5 Alice, Bob and Carol (and more) are devWallets with fresh mnemonics, held in page memory only. The server learns addresses and funds them with 1,000 ADA each. playground/main.js
D6 Forms from the description's schemas, per D6's table: integer, bytes (plus a UTF-8 helper and identities' key hashes), Bool, Optional, records and sum types, lists, maps with integer or byte-string keys (canonical order, repeats refused), Value. Anything else is UNSUPPORTED with its path. Unsupported calls are shown disabled with their code (e.g. unsupported: views on npm). playground/form.js
D7 Stages: arguments → host → verification → review → wallet → ledger. verifyPrepared for calls and verifyPublication for prerequisites. Anchors (policy, address, description) come from the session's pinned contracts.json bytes, not the host, and are cross-checked against deployment. A declined review is discarded. main.js
D8 127.0.0.1 only. A per-run 32-byte token goes in the URL fragment, then sessionStorage and a header. Host, Origin and Sec-Fetch-Site are checked; no CORS; OPTIONS is refused. Bodies are bounded JSON and validated per field. CSP default-src 'self'. Text-only rendering. server.js
D9 The mode banner says what offline success means, what the ledger checks and refuses, and what it doesn't model. A NotModelled refusal 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.js
Q4 memoryLedger adds OutputTooBigUTxO, WrongNetwork / WrongNetworkWithdrawal / WrongNetworkInTxBody, MissingTxBodyMetadataHash / MissingTxMetadata / ConflictingMetadataHash and ExtraneousScriptWitnessesUTXOW, plus a networkId option (default 0). js/joust/src/test/offline.js

The 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)

  • DevKit mode, /playground on joust dev, Connect wallet through the Cardano Foundation connector, journal and settlement (M3).
  • Gradle (M2).
  • Scenarios and @Quorum co-signing (M4).
  • Calls with a shared verifier (sends, MerkleMaps): shown disabled, because their anchors would come from the host in M1.
  • Keyed calls: they need the page's designation and retry rules (ADR-0016 M3).

Points for review

  • Discard after a ledger refusal. Protocol 1 names discarded for 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.
  • Verifier gaps. verifyPrepared still has the gaps the conformance test lists (pageGaps). The playground signs only what verifyPrepared accepts 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.
  • No slot config for verifyPrepared offline. Offline time is the ledger's slot, which time advances move, not the wall clock. The page checks windows against the session's now, which comes from the trusted chain (Investigate a trustless-provider mode for browser-only dApps #169).
  • Two verifyPublication checks are stricter than the reference checker: any witness script, and any witness datum or script data hash, on a publication is refused.
  • Owned calls are supported in the page, but the Chromium walkthrough covers Counter only (init, action, destroy are enabled; reset is refused for Bob).
  • Point 8 of docs(adr): ADR-0024 a dev playground over the dev host (proposed) #159 (dropping the Gradle "common bundle") still awaits confirmation. It does not affect M1.

Test plan

  • js/joust/test/playground.test.js, 16/16 locally:
    • I3: an offline session with fetch and sockets stubbed, launching only its host.
    • D4: the read adapter's encoding.
    • I9: two sessions with one reset, and LRU eviction at four.
    • I6: a rebuild makes prepare and publish stale; a new session gets a new fingerprint and can keep the ledger.
    • Stage-tagged refusals: a require, Bob's @OnlyOwner, a wrong signature refused by the ledger and then discarded, an unknown reservation.
    • I5: every route × missing or wrong token, DNS-rebinding Host, foreign Origin, Sec-Fetch-Site: cross-site and text/plain posts. No session is started and the clock does not move.
    • D8: bounded bodies; no path or URL arguments.
    • I8: every schema shape, unsupported paths, and the canonical map order.
    • I10: a changed .jsc interface fails without --accept-abi, and the manifest is unchanged; the project tree is hashed before and after a session.
    • M1 exit walkthrough in Chromium, for a Java and a .jsc Counter: create as Alice (publication + init), increment as Alice, refused as Bob, a declined review, advance time, reset.
    • I1: every request body the page sent has only known fields and no mnemonic or key.
  • offline-ledger.test.js 25/25 (was 18) and libraries.test.js 7/7.
  • state-client 328/328 (was 265): the 59 publication vectors in host-publication.test.js.
  • host-conformance.test.js + host.test.js 124/124; cli.test.js 13/13.
  • CI: a new "Test the playground" step in the engines job installs Playwright's Chromium (JOUST_REQUIRE_CHROMIUM=1: a missing browser fails rather than skips) before the no-skip check.
  • Reviewer: D5 (no key reaches the server) and D8 (the server's surface) against the threat model of ADR-0024 §2.
  • Reviewer: the discard-after-ledger-refusal point above.

🤖 Generated with Claude Code

satran004 and others added 9 commits November 24, 2026 01:10
…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>
@satran004

Copy link
Copy Markdown
Member Author

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.

Finding Change Where
Pre-sign check weaker than the protocol (I2): 86 tampered vectors were accepted New verifyHostResult in state-client, a port of the conformance kit's reference checker; the page signs only what it and verifyPrepared/verifyPublication accept. All 333 verifier vectors are decided as the reference decides them; map calls are refused as notVerifiable (no MPF check yet) js/state-client/src/hostcheck.js, js/joust/playground/check.js, hostcheck.test.js
The review showed host claims The review is built from the body and the checker's report: fee, window, signers, net outflow including gains. The created id is derived from the body. Host claims are compared with the body (planMismatch) main.js
Change at the caller's enterprise address Change is accepted only at the payer's exact address hostcheck
An inherited asset or route name crashed the server Lookups are own-property only; tested server.js
Concurrent sessions broke the bound of four and ledger isolation Session lifecycle runs one at a time; a prior session is taken out synchronously; sessions finishing after close() are closed; tested server.js
The token was in a log line and in argv The browser opens a private 0600 launcher file. The token is printed only with --no-open. A top-level navigation from it is allowed (r2: it had landed on a 403); tested in Chromium index.js, server.js
A settlement error hid an applied transaction The transaction is recorded before settlement session.js
A witness script beside a reference script was accepted Refused as ExtraneousScriptWitnessesUTXOW (Conway); tested offline.js
Registration was 'unknown'; stakeSelf address; a duplicated tab ended a session; served flag; now read late; failed reads had no tip Fixed session, server, main
Asset pay; reservations leaked on a throw or a failed submit; keyed calls offered; map contracts not detected Asset pay control; release on every exit; keyed disabled until M4; maps detected from definitions main.js
I1 and I3 tests I1 searches the server's logs and a heap snapshot for each identity's mnemonic, entropy and key. I3 counts the processes a session starts playground.test.js
The page was not prebuilt The release builds playground/dist release.yml

Deferred (P3): decode and budgets in the history; an I8 case per refused call kind. verify.js's #162 gaps stay for the dApp; the playground uses verifyHostResult.

Local tests: playground 22/22, js/joust host/conformance/ledger/cli 162/162, state-client 665/665.

satran004 and others added 2 commits November 24, 2026 10:19
…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>
@satran004

Copy link
Copy Markdown
Member Author

Author reply: round r3 · head 1847dbc

Codex's round-2 findings. The design and security reviewers approved round 2.

Finding Change
P1: the review showed host-supplied before/after state The checker's report has before (decoded from the resolved target input's datum), after (the body's checked continuation) and removed (for a destroy). The host's prediction is a folded section marked "unchecked, not used to decide". Chromium test: a false prediction of 999 never shows; the body's 7 → 8 does
P1: Plutus byte strings over 64 bytes accepted Datums and redeemers go through the pinned JuLC pre22 decoder's rules: at most 64 bytes per chunk; no text, floats or simple values; bignum tags only around bytes; constructor tags only in the valid ranges. Test cases were checked against the actual pre22 jar
P1: constructor indices beyond 2^53 compared equal They are refused (fail closed), which is stricter than JuLC; tested
P1: the launcher file held the reusable token One-time pairing. Every link the command opens or prints carries a single-use code (24 random bytes, 10 minutes). The page exchanges it at /pair, which has the same Host/Origin/site checks, for the token, which exists only in memory. The launcher file is then removed. Route matrix and reuse tests added
P2: pointer addresses were normalised An output address must round-trip to its received bytes; tested
P2: a lost submit response was reported as a failure The page reconciles against the session's history. It shows confirmed if the transaction is there, otherwise "outcome unknown", without releasing the reservation; tested in Chromium

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.

satran004 and others added 2 commits November 24, 2026 10:28
…; 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>
@satran004

Copy link
Copy Markdown
Member Author

Author reply: round r4 · head 4af1b89

Codex's round-3 findings. The security reviewer approved round 3; the design reviewer approved round 2.

Finding Change
P1: the first process to redeem the launcher code gets the token Declined by design. A process running as the same user is trusted like the user: it can already read the user's files and browser profile. The 0600 launcher and the one-time code protect against other users. This is recorded in ADR-0024 §2 (r3, 1714367f on #159)
P2: an unknown submission could not be resolved later The entry keeps its session and hash and offers "recheck", which updates it in place. Chromium test: every read fails, then a later recheck confirms it
P2: indefinite tag-102 pairs were refused Accepted, with exactly two elements and the break, as the pinned julc-core pre22 jar does. All six forms were checked against the jar and added to the comparison tests
P2: keyed calls' state reports before, after and removed now come from what the keyed rules decoded; their shapes are asserted on seven keyed fixtures
(security S8) The page calls pair and api/… relative to its location, so a page mounted under /playground/ works

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.

satran004 added a commit that referenced this pull request Nov 24, 2026
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>
satran004 added a commit that referenced this pull request Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
satran004 added a commit that referenced this pull request Nov 24, 2026
…round-m3

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

# Conflicts:
#	js/joust/playground/main.js
satran004 and others added 2 commits November 24, 2026 10:50
… 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>
@satran004

Copy link
Copy Markdown
Member Author

Author reply: round r5 · head acc0863

Codex's round-4 findings:

Finding Change
P2: the shared decoder could equate distinct constructor indices decodeData (behind dataEqual and verifyPrepared) refuses a tag-102 index above Number.MAX_SAFE_INTEGER before converting it, in both the definite and indefinite pairs. Tested through decodeData and plutusData
P2: a late confirmation hid a failed host settlement A rechecked confirmation shows the same notes as an immediate one, including the settlement warning; tested
P2: recheck after "new session, keep the ledger" Follow-up issue (round-4 rule: offline only, not security-relevant)

Local results: state-client 670/670, playground 23/23.

satran004 added a commit that referenced this pull request Nov 24, 2026
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>
satran004 added a commit that referenced this pull request Nov 24, 2026
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>
@satran004

Copy link
Copy Markdown
Member Author

Author reply: final pass · head 557f808

The final pass covered the whole branch at acc0863, with three reviewers:

  • Fable: approved. It found a functional P2 and some P3s.
  • Opus: approved. It ran about 20,000 host-side mutants through both the page's checker and the Java reference checker. There were 0 cases where the JS checker accepted what Java refused, and 0 the other way.
  • Codex: one high finding.
Finding Change
Codex (high) / Fable FF3: payouts to an identity's key hash were stranded at its enterprise address Each offline identity now uses its payment key's enterprise address everywhere: funding, payer, balance, and the wallet UTxO set the checks see. Chromium test: Alice releases a 600 ADA escrow to Bob, then Bob opens a 1,200 ADA escrow (more than his own 1,000), which only works by spending the payout
FF1: the contract list was not redrawn after a new session startSession and reset redraw it, and drop a contract the new build no longer serves. Chromium test: rebuild with a second contract, then "keep the ledger"
FF2: stray "null" text Fixed in the banner, instances and review
FF5: nits The attack toggle runs under guard; host sites are rendered only when they are an array; dead code removed
FO1: a prepare without a body Refused at stage host

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.

satran004 added a commit that referenced this pull request Nov 24, 2026
…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>
satran004 added a commit that referenced this pull request Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@satran004

Copy link
Copy Markdown
Member Author

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 fbb4d108, which releases the reservation whenever one was named.

Status of #174:

  • Design reviewer: approved (r2).
  • Security reviewer: approved (r3).
  • Codex: rounds 1–5 closed, then the final-pass findings closed.
  • Final pass: Fable approved, and Opus approved (a 20k-mutant differential against the Java reference found no divergence).

Follow-up issues will be filed for the deferred P2/P3 items. Merging is the maintainer's call.

satran004 added a commit that referenced this pull request Nov 24, 2026
…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>
satran004 added a commit that referenced this pull request Nov 24, 2026
…t/playground-m3

Conflict-free.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
satran004 added a commit that referenced this pull request Nov 24, 2026
…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>

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