Repository navigation
Conversation
…ent and the journal (ADR-0024 M3) - `joust playground --mode devkit [--network <name>]` attaches as joust dev does; only a DevKit is accepted (an admin API, network id 0, Yaci Store's API): mainnet never, public testnets not in v1 (I4). - `joust dev` on a DevKit serves the playground at /playground/ beside the project's page: the same handler with its own token, Host/Origin checks and no CORS (server.js is now a mountable handler); its page is built when first opened. - DevKit sessions (devkit.js): the same npm dev host; chain/read from Yaci Store at one chain point (script reads as CCL's PlutusScript, unknown stake registration unsupported, map history reads); `now` from the network clock; submission through Yaci Store; settlement from observed tips: confirmed (shallow) at the inclusion slot, final past settlementSlots (10), expired past validTo + settlementSlots, rolled back when an included tx leaves the chain. A node refusal is stage ledger and never discarded (handed out: only expiry releases its inputs). - The journal (journal.js, Q6, ADR-0022 D8): ~/.joust/state (JOUST_STATE_DIR), keyed by project and chain (network id, magic, genesis startTime); a body and the high-water mark are persisted before the page can sign; a new session restores what is left (bodies that landed meanwhile as shallow); lost history waits for the tip to pass the high-water mark; a reset DevKit starts empty and the old chain's journal is reported once and removed; 0700/0600, atomic writes, one playground per project and chain (a lock). - The page: DevKit test identities over the public DevKit mnemonic (labelled test-only, faucet top-ups by the server), Connect wallet through @cardano-foundation/cardano-connect-with-wallet-core 0.2.12 (Yano first; a wallet on another network refused), submitted / included / final shown apart with a confirmation timeout (I7). The connector moves to dependencies (the page is built from the installed package). - Tests: playground-devkit.test.js (a chain the test holds back or refuses: I7, refusal, expiry, discard, restart/restore, lost history, journal keying/pruning/locking, I4, the mounted handler's surface) in the engines job; playground-devkit-e2e.test.js on a real DevKit in Chromium (a test identity, an injected CIP-30 wallet, a wrong-network wallet, joust dev's /playground/) in a new playground-devkit CI job that requires DevKit and Chromium. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd-m3 Conflicts and how they were resolved: - server.js: the mountable handler (M3) keeps M1's fixes (serial session lifecycle with the `closed` flag, own-property routes and assets, the `registered` route) and takes M2's build `source`; DevKit sessions get it too. The handler's close() sets `closed`. - index.js: DevKit mode works for npm and Gradle projects: the network is checked (I4) and attached before the Gradle or npm build, gradlePlayground passes mode and the DevKit options; the URL goes out through M1's `announce` in every mode. The launcher file is now launcherFile(), shared with joust dev. - main.js: imports merged; DevKit settlement after M1's `report.submitted`. A body handed to a CIP-30 wallet is never discarded, even when the wallet declines (it was handed out: only its expiry releases its inputs); an identity's (in-page keys) still is. - joust.js usage: both texts. Follow-ups in this merge: - devkit.js opens M2's source (npmSource / gradleSource): the snapshot, digest, entries, launch and staleness come from it, so a Gradle project's JVM host runs on DevKit; `registered()` answers true, false or 'unknown' (Yaci Store cannot tell) for the publication checks; `served` only when the host says so; hostPid. - joust dev no longer prints the playground's token: it names a private launcher file (D8, as M1's announce), and the e2e test checks that no log line carries the token. - The page keeps the chosen wallet when it redraws the wallet list (a refresh had reset the choice). - playground-devkit-gradle.test.js: a Gradle Counter over the JVM host on a real DevKit, checked with check.js and settled from the chain (local only: no CI job has a staged repository and DevKit). - The native CLI's help names --mode devkit; the README describes Gradle on DevKit, the CIP-30 change address as the payer, and joust dev's launcher file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd-m3 Conflicts: - server.js: round 2's cross-site exception (a top-level document navigation for static GETs, the file:// launcher) now reads the path under the handler's base, so /playground/api/ stays same-origin only when mounted in joust dev, as /api/ does on the playground's own server; the mount's redirect comes after that check. - index.js: round 2's writeLauncher (with `file`, the ten-minute lifetime) is kept; M3's launcherFile is gone and joust dev's launcher uses writeLauncher (it lives until joust dev stops). The page: round 2 releases the reservation after a failed submit. On DevKit a body the node refused was handed out, so the page marks it submitted and never discards it (ADR-0022 D8: its expiry releases its inputs; the server refuses that discard too); a failure before the node saw the body is still released. A body a CIP-30 wallet declined stays undiscarded as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the chain, a verified chain, a safe journal
Codex (11 P1, 1 P2), design (D-1 to D-4) and security (M3-S1, M3-S2), each with a regression test:
- P1-1: what the page is shown comes from the journal and the chain (inclusion slots, tips), never
the host's reply; the host is told each event and a reply that disagrees fences it (it prepares
nothing more; the page says so).
- P1-2 / D-1 / D-2 / M3-S1: the chain API's genesis (magic, start) must be the admin API's before
anything is journaled, funded or submitted (and before joust playground --mode devkit starts);
the clock is the verified identity's; the public networks' magics (mainnet, 1, 2, 4) are refused;
another genesis or a tip that goes back ends the session ("the DevKit was reset").
- P1-3: before a CIP-30 wallet sees a body its handoff is journaled (never discarded after); discard,
handoff and submit (its validFrom wait included) run one at a time per reservation.
- P1-4: a body without a valid, new reservation is never handed out (and fences the host); a restore
must give one distinct id per body, or the journal stays as it was.
- P1-5 / P1-6: a settlement pass reads every inclusion between two equal chain points (else reads
again); inclusions are told first, each at its own slot, then depth and expiry at the tip, each
event on its own (one failure skips nothing).
- P1-7: the submission is recorded before it is sent; its answer never overrides the chain's state;
no answer (a dropped connection) is followed on the chain, a 4xx is the node's refusal.
- P1-8: the admin faucet only (no payment the server signs), its refusal shown; below 100 ADA only,
enforced by the server; one top-up per address at a time.
- P1-9: the journal is validated whole (version, each body's hash and bounds): anything invalid is
lost history behind the high-water mark; invalid with no mark is refused.
- P1-10: the lock is a hard link of a fully written token; a stale one is renamed aside and removed
only if still the dead token; every write checks the token (one writer, always).
- P1-11: pruning runs one at a time per DevKit, after the served genesis is checked again, keeps
chains a live playground owns, and persists the notice before deleting.
- P2: before each CIP-30 signature the wallet's network, change address and UTxOs are read again;
every input it pays from must be one it holds and DevKit shows unspent.
- D-3: ttlSlots at most the stability window 3k/f (admin API; else 300). D-4: a tab whose DevKit
session another tab took is told so.
- M3-S2: the state and chains directories must be this user's (made 0700 when permissive).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r1 · head 077f6c3 Review round 1 is addressed. Codex and the design reviewer asked for changes; the security reviewer approved, with a P2 and P3s. Every fix has a regression test.
Local results: the fake-chain suite plus CLI 40/40, DevKit e2e 6/6, Gradle on DevKit 1/1, playground 22/22, Gradle 19/19, state-client 664/664. Follow-up issue: |
…eat/playground-m3
- server.js: the handler mints single-use pairing codes and serves POST /pair under its base, so
joust dev's /playground/pair pairs a page as /pair does on the playground's own server (S8);
pairingPath() gives the base with a fresh code; startPlayground's pairingUrl() builds on it.
- dev.js: the launcher file holds a single-use pairing link (removed once spent), never the token;
no log line or file carries the token.
- index.js: announce() starts the server for DevKit and Gradle modes as for offline.
- main.js: pairing is relative ('pair'), so it works under /playground/; a lost submit answer on
DevKit is followed on the chain (the server journaled the submission first), offline it is
reconciled from the session's history as round 3 does; the history keeps settlement states.
- e2e: the pages pair; joust dev's launcher holds a pairing code, spent once, and then removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…no lock takeover, handouts bounded Codex r2 (7 P1, 2 P2) and the design's P3s, each with a regression test: - A rewind across settled history: the journal keeps the chain point where bodies left it (final or expired); a session of the same genesis that finds the chain below it builds nothing until the tip passes the high-water mark (tested through the next session's first prepare). - The lock is never taken over: a lock whose owner is gone is refused with its path and the command to remove it (as git's index.lock); pruning keeps any chain with a lock on it. - Two journal entries under one reservation id are lost history; chain observations are keyed by the transaction hash queried. - Before handout: the body's window is the one asked (validTo in (now, now + ttlSlots], validFrom below validTo), it is not a journaled body again, and it spends no input or collateral a journaled body spends; otherwise it is refused before any journal write and the host fenced. Restored duplicates keep their handoff and submission flags. - A discard takes a tip from the chain (never the clock); without one the body is kept and the discard can be retried. - A submit waiting for its window is cancelled by a reset or close; right before sending, the session, the served genesis, the reservation and its window are checked again. - P2: a 4xx for a body the chain already holds answers its inclusion (the refusal a transport detail), through the browser path too; the CIP-30 refresh requires every input and collateral to resolve before classifying it, and a missing one fails at stage wallet with no signTx (Chromium, over the controlled chain). - D-5: an inclusion is told to the host before the indexes are waited for (the page's state after, once the pass is done). D-6: the wallet's UTxOs are read again for a few seconds before an input is refused; a changed network or change address says to connect the wallet again. 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
|
Author reply: round r2 · head ef7015e Codex's round-2 findings, plus the design reviewer's round-2 P3s. The design and security reviewers approved round 2. This branch also merges #178 and #174 through their round 4. One-time pairing now covers
Local results: playground plus fake-chain DevKit 58/58, DevKit e2e 6/6, Gradle 33/33, Gradle on DevKit 1/1, state-client 668/668. This is round 3. From round 4, P2s that the security reviewer judges not security-relevant become follow-up issues. |
…and rewinds persisted, one POST per check
Codex r3 (3 P1, 4 P2), each with a regression test:
- A restore that drops settled history (bodies that settled while no playground ran, or history
lost with the journal) saves its removal point in the same write as the replacement entries.
- A rewind bound is persisted when it is found (at start below the removal point, or a tip that
goes back while running), loaded on every start, and cleared only after a tip strictly above it.
- One provider attempt per session check: Yaci Store's adapter no longer retries; the session's
own BadInputsUTxO retry waits cancellably and checks the session, the served genesis, the
reservation and its window again before every POST.
- An input a journaled body spends is reconciled against the chain before blaming the host: if the
chain shows that body expired it is settled there and the new body goes out; otherwise the new one
is refused, retryably ('pending'), and the host is not fenced.
- A failed genesis read before a POST is a retryable chainUnavailable; only a verified mismatch
resets the session.
- The page's 'final' of an inclusion found already past its margin waits for that body's indexing
wait (the host is told at once); a restore's newly found finals too.
- The wallet's network and change address are checked on every read, the retries' included.
- A reset session reports the reset before any other refusal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r3 · head 07acf43 Codex's round-3 findings. Every fix has a regression test.
Local results: the fake-chain suite plus CLI 55/55, DevKit e2e 6/6, Gradle on DevKit 1/1, playground 23/23, Gradle 35/35, state-client 669/669. This is round 4: from here, Codex P2s that are not security-relevant become follow-up issues. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
…wind fence, handouts checked and recorded together Codex r4 (5 P1), simplified to one fence, each with a regression test: - One persisted fence (journal.fencedUntil = the high-water mark): any stable observation (the watcher's or a handout's) below an earlier stable tip or below the removal point is a rewind. Builds are blocked at once; the fence is written, and taken in memory only once the write succeeded (every journal change now writes first); a failed write is retried every pass, and a watcher-found rewind ends the session only once its fence holds (close tries once more). - Clearing the fence needs a tip strictly above it and moves the removal point to that tip in the same write, so a second rewind below the cleared bound is found again. - Lost history completes its restore only on the stable observation it uses being strictly above the high-water mark; below it again, it waits. - The watcher compares each observation with the removal point as well (a rewind below an expiry a handout observed). - A handout reconciles overlapping bodies first (its awaits), then checks the session's eligibility, the body, its reservation and every input against the journal as it is now and records it, with no await in between: two concurrent handouts of a shared input cannot both go out. 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>
|
Author reply: round r4 · head fe8e6b9 Codex's round-4 findings. Every fix has its own test.
The branch also merges #178 through Local results: fake-chain plus CLI 59/59, DevKit e2e 6/6, Gradle on DevKit 1/1, playground 26/26, Gradle 45/45, state-client 669/669. This is round 5: from now on only P0/P1 and security-relevant P2s block; other P2s become follow-up issues. |
…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>
…rt, every chain point checked, fences kept on close Codex r5 (4 P1 kept, 1 declined), each with a regression test: - A start whose tip checks are all inconclusive is refused (chainMoving), never admitted unchecked. - The restore's stable chain point and every answered host reverse read's tip go through the one rewind check; a fence it finds blocks the handout of the body being prepared, until a stable tip passes it. - A close whose fence still cannot be written keeps the journal's lock (in this process the journal stays locked; after a restart it is a stale lock to remove by hand) and leaves a marker with the bound when it can, which the next open writes as the fence. - An expiry found during a handout removes the entry only if it is still the body observed (same reservation, hash, body, prepared); otherwise the overlaps are reconciled again. - Declined (the branch is unreleased, no journal carries round 3's field): importing rewoundUntil. Instead a journal of another version or with any field this joust does not know is refused (journalUnknown), never opened with the unknown part ignored. - The P2 follow-up, as it is small: a session that started fenced is not ended by the chain catching up below the removal point; only a tip going back within the session ends it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Author reply: round r5 · head 4da2dac Codex's round-5 findings. Every fix has a test.
Local results: fake-chain plus CLI 65/65, DevKit e2e 6/6, Gradle on DevKit 1/1, playground 26/26, Gradle 45/45, state-client 669/669. The final pass (Codex, Fable, Opus) runs on this head. From here on, rewind corner cases that need a same-genesis rewind, which a single-node DevKit does not produce (a reset changes the genesis and is handled), become follow-up issues unless they fail open on a realistic path. |
ADR-0024 M3:
joust playgroundon Yaci DevKit, with test identities, Connect wallet (CIP-30), settlement and the per-user journal. Stacked on #178 (M2); the base isfeat/playground-m2.What it adds
joust playground --mode devkit [--network <name>]attaches to the network asjoust devdoes.adminAPI and network id 0 is accepted. Mainnet is impossible, and public testnets are refused in v1 (Q3).joust devserves the playground at/playground/, bound to its network, and never shadows the project's page at/./playground/api/same-origin only.joust devlogs the path of a private launcher file, not the token.js/joust/src/playground/devkit.js):chain/readis answered from Yaci Store at one stable chain point (re-read if the tip moves), andnowcomes from the network clock.settlementSlots(10). A transaction pastvalidTo + 10is expired; an included one that disappears is rolled back.ledgerand is not discarded, as the protocol requires.confirmation(I7).journal.js, Q6):~/.joust/state, overridable withJOUST_STATE_DIR, keyed by project and chain: network id, magic and genesisstartTime.devWallets over the publicDEVKIT_MNEMONICby index, labelled test-only and topped up by the server from the faucet. Their keys stay in the page.@cardano-foundation/cardano-connect-with-wallet-core0.2.12, withNetworkType.TESTNET, Yano listed first plus any other injected CIP-30 object. A wallet on another network is refused.verifyHostResultplusverifyPrepared/verifyPublication) and the review/approve step.playground-devkitjob starts DevKit and runs the e2e suite in Chromium, with DevKit and Chromium required and no skips.js/joust/README.md.Tests (local, real Yaci DevKit)
playground-devkit.test.js+cli.test.jsplayground-devkit-e2e.test.js(DevKit, Chromium)playground-devkit-gradle.test.js(a Gradle Counter over the JVM host on DevKit)playground.test.jsplayground-gradle.test.jsplayground-devkit-e2e.test.jscovers:joust dev's/playground/.The fake-chain suite covers:
Points for review
devkit.@julclang/joust, since the page is built from them.playground-devkit-gradle.test.jsruns locally only: no CI job has both a staged Maven repository and DevKit.🤖 Generated with Claude Code