{
  "notes": "Episode 3. Read goal.json and the orchestrator reference; no results were handed. State found: 7 of 50 items used; trunk at 423999f8ba694b2b9534fece6545207072e87b4b (wave 1 only: src/TestToken.sol, src/ShareStaking.sol, site/, release/, tests); ep02-integrate (3 code items) had not started any item; ep02-acceptance was refused last time (one code wave at a time) with its read and wake; the token-only child that episode 2's notes describe was never opened (children.list empty, every door opened 0, pools: onchain 2 left, offchain 1 left). No mandates, watches or asks (asks.max 0).\n\nThe requester's note of 2026-11-22T22:47Z governs and replaces episode 2's plan: nothing a goal item writes can be deployed, contracts reach Sepolia only through an order; open ONE workflow.open now holding the token (named test, ticker TEST), the staking contract for it in the same launch, and the dashboard website on the live contracts; keep token and staking in one workflow because an order cannot name an address another child deployed; use what the staking and website items found as the spec in the order's words; spend no more items rebuilding the contracts or the site. So: never open a separate token launch, never run release/deploy.py, and do not spawn build waves.\n\nDecided this episode:\n1) open, key test-staking-launch-site, action workflow.open, body {request, draft}. Draft: shape chain, onchain evm_project, chainId 11155111, github true, ipfs true, contracts [TestToken, ShareStaking], steps build-contract-project, frontend-for-contract, adversarial-review (the documented chain: the review runs before deployment and the front end after it, wherever listed). It uses one onchain and the one offchain deliverable; afterwards only launch.open has budget (1 onchain), which this goal does not need.\n2) cancel ep02-integrate: its three items would rebuild contracts and site on a trunk that cannot be deployed, which the requester ruled out. ep02-acceptance is not asked for again.\n3) no spawn, no read. wake afterMinutes 720 with no batch named, so that a child.settled wake (or a requester note) starts episode 4 and the timer is only a fallback.\n\nOrder shape, learned from the network's public docs read this episode (https://imd.fun/skill.md, https://imd.fun/skill/workflows.md, https://imd.fun/skill/jobs.md, https://api.imd.fun/requests/capabilities): the draft is a strict job body (unknown fields refused): objective, shape (chain or dag, required with steps), onchain (evm_project, evm_contracts, custom_token, univ4_hook), chainId, pairWith (eth by default, the only pairing on Sepolia), economics (optional on evm_project: only poolBps and remainderTo), github, ipfs (true or a site label), contracts (up to 4 names), references, steps (1 to 6; each skill, optional objective up to 3,000 characters and 1 to 8 acceptanceCriteria of up to 500; a dag also needs key and dependsOn on every step). A workflow draft needs onchain set, ipfs set, exactly one frontend-for-contract or build-website step (last or second to last in a chain) and an adversarial-review, and the request must itself ask for an independent security review before deployment or the check blocks it (recheck_failed). request plus draft.objective must fit 8,000 characters; mine are about 6,000 together. Refused in a draft: parentJobId, projectId, deploymentLaunchId, submissionKey, and from a goal any owner or address field and any 0x address in the words. Outside a goal a workflow also takes context and permissions {github, ipfs, onchain:{kind, chainId}}; the goal reference shows only request and draft, so I sent only those and expect the plane to fill permissions and the owner.\n\nLaunch facts for an evm_project: the token is the launch's standard one, 1,000,000,000 with 18 decimals and plain transfers, minted whole to the launch factory; ten percent goes to the swarm, the requester's ninety seeds the Sepolia ETH pool by economics.poolBps and the rest goes to the paying wallet. I set no economics: the goal names no split, so the platform default stands. Asking for another supply or transfer rule would draw a launch_token blocker. The earlier trunk design (constructor-chosen supply minted to the deployer) is therefore superseded; the staking design is kept. Symbol: the objective says ticker test and the requester's note says ticker TEST; I followed the note, name() test and symbol() TEST, and the write-up should say so.\n\nSpec in the order, from the trunk's ShareStaking and site: ShareStaking(token) with the launch token reference as only constructor argument, immutable, ownerless, no lockup or fee; stake, withdraw, token, totalStaked, stakedBalance, pointsOf, events Staked and Withdrawn; one point (10^18 units) per occupied second for the whole pool, split by stake over total stake, idle seconds earn nothing, points only grow and are not transferable; cumulative index with remainders carried so the sum of points never exceeds occupied seconds; worked example A 100 at 0, B 300 at 100, A out at 200, B out at 300 gives A 125 and B 175. Site: static dashboard, injected wallet, switch to Sepolia, exact approval, stake, withdraw, balance, allowance, stake, total, share percent, points, receipts awaited, token() binding checked against the deployment record, read-only totals before connecting.\n\nEpisode 4, first read goal.json children and wakes. (a) Order refused: read why, mend only that, and send it again under a NEW key (for example test-staking-launch-site-2); never reuse the key and never open a second launch beside a live one. Likely mends by reason: a field the door does not take (drop github, or chainId since Sepolia is the default); a missing field (add context, or permissions {github true, ipfs true, onchain {kind evm_project, chainId 11155111}}); objective_too_large (shorten request and draft.objective); recheck_failed (keep the independent review sentence in request); launch_token (keep the token to the standard terms); a contracts problem (name only ShareStaking). (b) Child still running (workflow stages: contracts, deployment, frontend, publishing, validating, which may retry for up to a day while hosting settles): spawn nothing, cancel nothing, wake afterMinutes 1440 and let child.settled start episode 5. (c) Child completed: read its result (/jobs/<id>/result, and the workflow record: contracts repo and commit, launch id and status live, handoff manifest with addresses, site cid and ENS name, validation report). If an episode is left, spawn one small research batch of at most three items, each one check with a JSON result of passed, failed and unperformed checks with evidence: token name, symbol, decimals and totalSupply on chain 11155111; ShareStaking token() equal to the token address and its code present; the public site's dist/imd-deployment.json addresses equal to the launch's and the page loading from its gateway URL. Then finish. In the last episode set finish true with what has landed and write the limits plainly: which of token, staking contract and site are live with addresses, transactions and URL, what was verified by whom, and what is still pending. Do not present the trunk's local tests or a served folder as the Sepolia launch or the published site.",
  "open": [
    {
      "key": "test-staking-launch-site",
      "action": "workflow.open",
      "body": {
        "request": "On Ethereum Sepolia (chainId 11155111), launch a token, a staking contract for that token, and a website built on the two live contracts, as one workflow. Token and staking contract belong to the same launch.\n\n1. Token. An ERC-20 whose name() is exactly \"test\" and whose symbol() is exactly \"TEST\", with 18 decimals. It is the launch's standard token and asks for nothing else: a fixed supply of 1,000,000,000, minted once at deployment the way the launch requires, plain transfers that move exactly the amount asked, no fee, no later mint, no owner, no pause, freeze or upgrade. If the launch rules fix the token's contract name or file layout, follow them; name() and symbol() stay test and TEST.\n\n2. Staking contract, ShareStaking. Deployed in the same launch and bound at construction to that token: the launch's own token reference is its only constructor argument and the binding is immutable. No owner, admin, pause, fee, lockup or upgrade, and nothing has to be called after deployment. Anyone may stake(amount) after approving, and withdraw(amount) any part of their stake at any time. Principal always comes back in full, and withdrawing never removes points already earned. Points reward how long you have staked, by your share: for every second in which at least one token is staked, the pool as a whole earns exactly one point (18 decimals, so 10^18 point units), divided among that second's stakers in proportion to each one's stake over the total stake. A second with nothing staked earns nobody anything. Points are a number per account kept by the contract that only grows: not a token, not transferable, not spendable or redeemable. Views: token(), totalStaked(), stakedBalance(account) and pointsOf(account), where pointsOf includes what has accrued up to the current block, not only up to the account's last transaction. Events: Staked(account, amount) and Withdrawn(account, amount). A zero amount reverts, and so does a withdrawal above the caller's stake. Accounting: a cumulative points-per-staked-token index brought up to date before every change of stake, with division remainders carried forward for the pool and for each account, so that the sum of all accounts' points never exceeds 10^18 times the number of occupied seconds and falls short of it by dust only. Rounding never favours a staker. Worked example the tests must reproduce exactly: A stakes 100 tokens at second 0, B stakes 300 at second 100, A withdraws everything at second 200, B withdraws everything at second 300. A then has 100 + 25 = 125 points, B has 75 + 100 = 175 points, together 300, the number of occupied seconds, and both have their tokens back.\n\n3. Tests and review. A Foundry test suite with unit tests and fuzz or invariant tests for the split of points, conservation under rounding, return of principal, partial withdrawals, staking again after a withdrawal, and idle seconds. Before deployment, an independent adversarial security review of both contracts by a different reviewer (reentrancy, rounding and precision abuse, first-staker and dust-stake manipulation, overflow over long durations and large stakes, a wrong token binding). What the review finds is fixed before anything is deployed.\n\n4. Website. A static dashboard built against the deployed addresses and ABIs, published to GitHub and hosted on IPFS. A visitor connects an injected wallet, is offered the switch to Sepolia, and can approve, stake and withdraw. The page shows the wallet's test balance, its allowance to the staking contract, its staked amount, the total staked, its share of the pool in percent and its points, each read from the live contracts and refreshed as blocks arrive. It states the points rule in one or two plain sentences, shows both contract addresses with Sepolia explorer links, and says where test can be obtained when the deployment record names the launch pool. It approves only the amount being staked, waits for every receipt, shows pending, confirmed and failed states with readable errors, and enables no action unless the staking contract's token() equals the token address of the deployment record. Before a wallet is connected it shows the pool totals read-only from a public Sepolia RPC. No backend, no analytics, no mock data, no placeholder addresses, no private keys.",
        "draft": {
          "objective": "Build, review, deploy on Sepolia (chainId 11155111) and then put a website on: the launch token, an ERC-20 with name \"test\", symbol \"TEST\", 18 decimals, the launch's standard fixed supply of 1,000,000,000 and plain transfers with no fee, later mint, owner, pause or upgrade; and ShareStaking, a staking contract in the same launch whose only constructor argument is the launch's token reference, immutable, with no owner, admin, fee, lockup or upgrade. ShareStaking has stake(amount), withdraw(amount), token(), totalStaked(), stakedBalance(account), pointsOf(account) and the events Staked and Withdrawn. For every second with at least one token staked the pool earns exactly one point (10^18 units), split among that second's stakers by stake over total stake; idle seconds earn nothing; points only grow, are not transferable and are not a token; principal is always withdrawable in full and withdrawing keeps earned points; pointsOf includes accrual up to the current block. Use a cumulative index with remainders carried forward so the sum of points never exceeds 10^18 times the occupied seconds and misses it by dust only. Tests must reproduce: A stakes 100 at second 0, B stakes 300 at second 100, A withdraws all at 200, B withdraws all at 300, giving A 125 points and B 175. Foundry unit, fuzz and invariant tests, then an independent adversarial review before deployment, with its findings fixed. After deployment, build the static dashboard against the live addresses and ABIs: connect an injected wallet, switch to Sepolia, approve the exact amount, stake, withdraw, and see wallet balance, allowance, staked amount, total staked, pool share in percent and points, all read from the contracts. Host it on IPFS.",
          "shape": "chain",
          "onchain": "evm_project",
          "chainId": 11155111,
          "github": true,
          "ipfs": true,
          "contracts": [
            "TestToken",
            "ShareStaking"
          ],
          "steps": [
            {
              "skill": "build-contract-project",
              "objective": "One Foundry project with the launch token (name test, symbol TEST) and ShareStaking, with their tests. Keep the token to the launch's standard terms; put all the staking and points logic in ShareStaking.",
              "acceptanceCriteria": [
                "The token's name() returns test, symbol() returns TEST and decimals() returns 18; its supply is the launch's fixed 1,000,000,000, minted once, and transfers move exactly the amount asked with no fee.",
                "ShareStaking takes the launch's token reference as its only constructor argument, exposes it as an immutable token(), and has no owner, admin, pause, fee, lockup or upgrade path.",
                "A test reproduces the worked example exactly: A stakes 100 at second 0, B stakes 300 at second 100, A withdraws all at 200, B withdraws all at 300; A ends with 125 points and B with 175, in 10^18 units, and both hold their full principal again.",
                "Fuzz or invariant tests show the sum of all accounts' points never exceeds 10^18 times the occupied seconds and falls short by dust only, and that the contract's token balance equals totalStaked() and the sum of stakedBalance over all stakers.",
                "Tests show any staker can withdraw any part or all of their stake at any time, that withdrawing never lowers points, that points never decrease, and that seconds with nothing staked award no points.",
                "pointsOf(account) includes points accrued up to the current block timestamp without any transaction, and a zero amount or a withdrawal above the caller's stake reverts."
              ]
            },
            {
              "skill": "frontend-for-contract",
              "objective": "A static dashboard for the live test token and ShareStaking on Sepolia: connect, switch network, approve, stake, withdraw, and read balance, allowance, stake, pool total, pool share and points.",
              "acceptanceCriteria": [
                "Every address and ABI comes from the workflow's deployment record; the page holds no hard-coded, placeholder or example address and no mock data.",
                "With an injected wallet a visitor can connect, switch to Sepolia, approve exactly the amount being staked, stake and withdraw; each transaction's receipt is awaited and pending, confirmed and failed states are shown with readable errors.",
                "The page shows the wallet's test balance, its allowance to ShareStaking, its staked amount, the total staked, its pool share in percent and its points, each equal to the contract read at the same block and refreshed as blocks arrive.",
                "No action is enabled unless ShareStaking's token() equals the token address of the deployment record.",
                "Before a wallet is connected the pool totals are shown read-only from a public Sepolia RPC, and the page explains the points rule in one or two plain sentences with explorer links to both contracts.",
                "The export is static with relative asset paths, works when served from an IPFS gateway, and has no backend, analytics or private key."
              ]
            },
            {
              "skill": "adversarial-review"
            }
          ]
        }
      }
    }
  ],
  "cancel": [
    "ep02-integrate"
  ],
  "wake": {
    "afterMinutes": 720
  },
  "finish": false
}
