Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
98dc2e3
feat(season): add Season 2 contract with daily court, Bram's shelf an…
dadadave80 Nov 13, 2026
c9031bf
feat(season): mirror Bram's integer pricing in TypeScript with a 1,00…
dadadave80 Nov 13, 2026
cb9faeb
test(season): regenerate best-haul constants from an exhaustive court…
dadadave80 Nov 13, 2026
c72993d
build: include the season contract in the wasm build
dadadave80 Nov 13, 2026
65c1cb0
docs(season): document court, trade and storage rules in the contract
dadadave80 Nov 13, 2026
b42ac55
docs: record Season 2 local contract and revived on-chain pricing
dadadave80 Nov 13, 2026
30ad257
test(season): check the cargo table matches the contract and record t…
dadadave80 Nov 13, 2026
6c5d397
feat(season): mint reed from a docked moth and keep every maximal haul
dadadave80 Nov 13, 2026
be6409f
test(season): run the season wasm against the real root stack in a sa…
dadadave80 Nov 13, 2026
99ec1ff
docs: record the season sandbox run and the moth mapping
dadadave80 Nov 13, 2026
705faf1
chore(season): deploy script and testnet deployment record
dadadave80 Nov 13, 2026
e46ac47
feat(season): allow exact season calls in the signer and keep the fin…
dadadave80 Nov 13, 2026
ad5389e
feat(season): quote, reason-line and state models; generated season i…
dadadave80 Nov 13, 2026
2a8642c
feat(season): typed season actions through the harbor controller
dadadave80 Nov 13, 2026
9bc7725
feat(season): Bram's shelf and till, today's tide and Mochi's wish be…
dadadave80 Nov 13, 2026
d8f2b68
fix(season): treat a refused wish as refused; show device tide return…
dadadave80 Nov 13, 2026
6f8bef7
docs: record the Season 2 screens and season icon pipeline
dadadave80 Nov 13, 2026
8db2b3a
fix(season): season words for thrown errors, lock while a request is …
dadadave80 Nov 13, 2026
7d874b5
docs: note where the season allowlist is enforced and the Today's Tid…
dadadave80 Nov 13, 2026
392f7e1
docs: record the Beacon Court day browser check
dadadave80 Nov 14, 2026
23b944a
test(season): record a live testnet day and lower trade gas to 30 Tgas
dadadave80 Nov 14, 2026
c065c74
fix(season): make the live-day script typecheck
dadadave80 Nov 14, 2026
4657e6c
fix(season): refuse a second ledger deposit and show pre-send refusal…
dadadave80 Nov 14, 2026
7a48df2
fix(season): roll the device preview over each day like the contract
dadadave80 Nov 14, 2026
1812bc7
fix(season): keep focus inside the panel, hide the wish form without …
dadadave80 Nov 14, 2026
987e3cb
fix: pass the records flag through the production release build
dadadave80 Nov 13, 2026
54a5e13
fix(season): pass the Season 2 flag through the production release build
dadadave80 Nov 14, 2026
14e5664
build: run the season contract's break tests in make break
dadadave80 Nov 14, 2026
0f855dd
fix(season): list the season calls in the key line's signer actions
dadadave80 Nov 14, 2026
0ed29ab
fix(season): leave the season screens out of builds without the flag
dadadave80 Nov 14, 2026
949b160
docs: record the Season 2 UI review fixes, rebase and release flag
dadadave80 Nov 14, 2026
b8dd3ca
Merge remote-tracking branch 'origin/main' into feat/season-two-ui
dadadave80 Nov 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ judge:
bun --no-env-file scripts/judge.ts

break:
cargo test --manifest-path contracts/Cargo.toml -p familiar-root break_ -- --nocapture
cargo test --manifest-path contracts/Cargo.toml -p familiar-root -p familiar-season break_ -- --nocapture
bun test services/relayer/src/auth/sign.test.ts
6 changes: 6 additions & 0 deletions PROGRESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Full earlier progress and acceptance records are preserved in the [archive](docs
| 2026-11-13 | Mochi's sealed note on local branch `feat/sealed-note` (flagged off) | `bun run test` 247 pass/15685 assertions; `cargo test --manifest-path contracts/Cargo.toml --workspace` 123 pass/2 ignored; `make build`, `bun run build:release`, `make browser` (Chromium/WebKit), `make evidence` (15 signatures) pass; mocked note UI viewed at 390×844 and 1440×900; `bun --env-file=<main checkout .env> scripts/sealed-note-live.ts` | Live 2026-11-13: keyless `GET /v1/model/z-ai%2Fglm-5.3-flash` → `providerType:vllm, attestationSupported:true`; keyless `GET /v1/attestation/report` (ed25519, fresh nonce, `x-no-aliasing`) → 200 with 3 instances sharing key `5a0210f2…0caff`, all verified by SDK 0.3.0 (`UpToDate`, GPU evidence required); CORS allows the production origin. Three live completions with `X-Encryption-Version: 3`: chats `8af36ee4753d4228994b34ee1a8183ab` and `f63baa0caeb549f4932deb02daa59745` were broken (GLM spent all 120 tokens reasoning, `finish_reason:length`, empty content, despite `chat_template_kwargs.enable_thinking:false`); after switching to `thinking_token_budget:0`, chat `daa6b15838fc402689766a28b7826446` returned `provider_tee`, decrypted and **sealed**. Then the real `writeSealedNote` ran inside Playwright Chromium and WebKit (SDK default browser verifiers via NEAR AI's PCCS/NRAS proxies, WebCrypto Ed25519) against the relay code in-process: chats `20d3c9c6263b42edac0533dd02eb89d4` (Chromium) and `d8b367f524824d53ad99bb8f2849d736` (WebKit) both **sealed**, and the note stayed attached after a later accepted return. Five live completions in total. Read-only testnet views: `tidebound_journey` on `familiar-game.testnet` returns `claims` (qa-maker-v2: 2, dadadave80: 0) and `rpcNoteChain` reads them; unregistered keys resolve to no player. Eligibility/identity in the live runs were local stand-ins; no Privy JWT, deployed relay or Vercel variable was exercised. The in-game satchel with the flag on was not viewed; the note component was viewed standalone with mocked results and in the live browser run. No push or deployment. |
| 2026-11-14 | Sealed-note review fixes on `feat/sealed-note` (still flagged off) | `bun run typecheck`; `bun run test` 250 pass/15699 assertions; `cargo test --manifest-path contracts/Cargo.toml --workspace` 123 pass/2 ignored; `make build`, `bun run build:release`, `make browser` (Chromium/WebKit), `make evidence` (15 signatures) pass; mocked note UI at 390×844 and 1440×900 (all five states, no horizontal overflow, no console errors); offline in-browser seal check in Chromium and WebKit with a locally signed `provider_tee` record | Relay: the note-once lock is replaced by 3 notes per account per UTC day plus 3/hour per account and 120/hour overall, so a broken note can be asked again; the completion call aborts after 35 s and signature polling runs for up to 10 s (tests cover the daily reset, a hung upstream and the polling window). Browser: a missing signature is a distinct "seal not recorded yet" state that is shown, retryable and never stored; the final Ed25519 check is the SDK's `verifyModelResponse` (tweetnacl), and the offline browser check sealed in both engines with `crypto.subtle.verify`/`importKey` disabled and rejected a flipped signature. The back of each note states only what that note established (sealed: full claim and shared-key limit; not sealed/unrecorded: attestation, encryption and the exact reason; broken: model and what happened). Keyboard focus moves to the note and a polite status region announces the outcome (checked in Chromium via the mocked fixture; no screen reader was run). No live NEAR AI completion was made for these fixes; no push or deployment. |
| 2026-11-14 | Sealed-note second review fixes | Independent re-review (2 reviewers, each finding verified) confirmed 5 issues; `bun test services/relayer/src/sealed-note.test.ts web/src/note` 18 pass; full `bun run test`, `make build`, `make browser` (Chromium/WebKit), `make evidence` pass | All three note allowances are checked before any is charged (a refusal no longer uses up the next day); daily refusal is `QUOTA_DAY`, hourly/global `QUOTA` keeps Ask again; register reads (8 s each), completion and signature lookup are bounded from request start (55 s budget) and a late request is refused before charging; invite copy back to “One note per harbor.” to match the component; unrecorded notes offer “Ask for a new note”. Final check of these fixes confirmed two more and both are fixed: a failed retry keeps the readable unrecorded note and says so visibly and to screen readers, and a request refused for lack of time returns `NOTE_LATE` instead of claiming the register was unreadable. The retry-keeps-note path is typechecked but not exercised in a browser. Not run against live NEAR AI. |
| 2026-11-13 | Season 2 contract built locally (`feat/season-two`), not deployed | `cargo test --workspace` 175 passed/2 ignored (52 in `familiar-season`), `bun run test` 238 pass, fmt/clippy (`-D warnings`) clean, `make build`, `make evidence`, 27 season `break_` tests; `scripts/build-contracts.sh` output 232290 bytes, code hash `7EAyjP7NpCMPTiiHMdjtNh3VzkfKekcfFQfhUcjgW4UJ` (reproduced twice). `#[private]`, deposit rejection, JSON argument decoding and the `nft_token` callback gas have not run in Wasm or a sandbox | New self-contained `season` contract: daily court alternating `first_light_v1`/`first_light_v2` by day parity (fresh beacon outing), cargo table lens→glass, chart/salvage→reed, moth/vane unmapped (awaiting David's choice). Best hauls regenerated by exhaustive search on both the TypeScript engines and the contract replay: v1 rope (1 glass, 1 reed), v1 lantern (1, 2), v2 either tool (1, 0), so v2 days can never mint reed. Integer x^0.7 as isqrt × fifth root; `pricing.ts` matches `pricing.rs` on 1,000 seeded cases. Discrepancy: the brief's "her account's balance" purse is a per-pet ledger entry in `season`, not the pet account's balance. Root, Items, Pet and every Season 1 record, hash and fixture unchanged. No deployment, signing or push. |
| 2026-11-13 | Season 2 cargo table moth→reed; season Wasm run in a local sandbox, not deployed | `bun run test:season-sandbox` (near-workspaces 0.24.0 sandbox, real Root/Items/Bakery/Market/mock pool/global Pet stack, day 20770 = `first_light_v1`) 1 passed; `cargo test --workspace` 175 passed/3 ignored; `bun run test` 238 pass; fmt and clippy `-D warnings --all-targets` clean; `scripts/build-contracts.sh` output 233708 bytes, code hash `3FbynwMm2uWs8bahXSCoqDdrKsEJ1on6rR1C277hXNzy` (reproduced twice) | On Wasm: `new`, `on_wish_owner`, `on_storage_withdraw` reject strangers as private; deposits on `claim_daily`/`buy`/`sell`/`set_wish`/`cancel_wish` rejected; doctored courts refused (`ERR_WRONG_COURT`, `ERR_RETURN_REQUIRED`, `ERR_RULES_VERSION`, `ERR_REPLAY_CONTEXT`); second claim `ERR_ALREADY_MINTED`; `max_price`/`min_price` enforced; `set_wish` at 60 Tgas prepaid through Root `nft_token` (1.851 Tgas burnt of 10 attached) and `on_wish_owner` (1.808 refused / 2.363 waiting / 3.189 replace-and-fill of 35 attached), totals 6.910/7.466/8.297 Tgas; non-owner holds no Shells, storage or postcard; cancel refunds. moth→reed gives v1 rope two maximal hauls (1,1)/(0,2), so `BEST_HAUL` is now a Pareto list per tool and v2 best is (1,1) for both tools. Not run on Wasm: the `first_light_v2` court, day rollover/till refill (100k-block fast-forward did not finish in 10 min), trade-triggered wish fills, `storage_withdraw`. |
| 2026-11-13 | Season 2 contract deployed to testnet (David approved deploy and moth→reed) | `bun --env-file=.env.tidebound scripts/deploy-season.ts 3FbynwMm2uWs8bahXSCoqDdrKsEJ1on6rR1C277hXNzy`; create `7dvJZxqvfZxCQAgVoXfuJYaWWXTFF4zESphCkeVNhAy8`, fund `FR1rLGKriDpyF2R5WfCYUb3EVaz1mAbMoJyWiBA2vkTN`, deploy+init `6Bcz3vMmiG2P6P5eySzQNgBh68Frsk3qK7JciPmyk4WD`; independent fastnear `view_account` reads code `3FbynwMm…XNzy`, 234087 bytes | `season.familiar-game.testnet` initialised with root `familiar-game.testnet`; `get_shelf` day 20770, till 300, glass 40 @ 8, reed 40 @ 4. Root paid only 0.05 NEAR to create it; code storage funded by faucet account `familiar-season-fund-mwfjxq50.testnet` (key discarded). Season keeps one FullAccess key (the root's admin key) for fixes before the deadline, disclosed like Root/Items. No UI yet; no player has traded. |
| 2026-11-13 | Season 2 game screens built locally behind `VITE_SEASON2_ENABLED` (`feat/season-two-ui`), not deployed | `bun run test` 259 pass; `cargo test --workspace` 175 passed/3 ignored; `make build`, `make browser` (Chromium/WebKit), `make evidence`; `bun run test:season-browser` at 390×844 and 1440×900 on day 20770 (`first_light_v1`) and day 20771 (`first_light_v2`: the 17-step rope route was played through the real controls, kept as a tide return, First Light home and return memories unchanged) | Bram's shelf and till read live `get_shelf`/`get_today` from `season.familiar-game.testnet`; quotes simulate unit by unit and match the live one-unit `buy_price`/`sell_price`; trades send `max_price`/`min_price` from the shown quote. Signed out, the market is a labelled device preview using `pricing.ts`. Today's tide starts a fresh Beacon Court outing kept apart from First Light progress and docks it with `claim_daily`. Mochi's wish sets/cancels and shows the postcard. Signer allowlist now admits exactly `claim_daily`, `buy`, `sell`, `set_wish`, `cancel_wish` and `storage_deposit` (0.0125 NEAR exactly) on `season.<root>`. Browser check: views live, signed-in ledger and signing mocked in a dev-only harness. **No signed-in trade, claim, wish or registration has run on testnet.** Under the production Privy provider the hosted relayer signs nothing native; season calls are checked by `validateNativeIntent` in the browser (`privy-adapter.ts`), so the allowlist and receiver gates go live on merge even with the flag off (no UI calls them then). The near-auth relayer path uses the same validator but its deployed copy is unchanged. Discrepancy: `web/PRODUCT.md` says Today's Tide is coming soon and not playable; with the flag on it is playable (product docs not edited). Even (`first_light_v1`) days cannot be sailed from the current game. Icons generated with gpt-6-astra via Codex CLI; provenance in `web/public/assets/season/provenance.json`. |
| 2026-11-14 | First live Season 2 day on testnet (day 20771, Beacon Court) | `bun --env-file=.env.tidebound scripts/season-live.ts` (faucet rate-limited, so root created `qa-season-mwfncbhi.familiar-game.testnet` with 0.3 NEAR): storage_deposit `H2JB6GcoiaHURYESUFqbbg6bkLAx8UzTm3AXDsZe6koE` 2.159 Tgas; claim_daily `BPH4quoUi5CnKmkwRoZZExCfs4mZ2zgMFUoKL8Lmayk5` 3.699 Tgas; sell glass `4KZnGDNJV7Hf6PP7MXfxUgqcdG25EYPnq22GM9XgXA5A`, sell reed `DVckVNtfN8cHACkCGCc5QaKJKxbCvyfU7Jw59rPFWecY`, buy reed `4XUZB8QnFvoKBzJMZqXWmGxsB9xzNTYbS2txLPiU9aMZ`, 2.536 Tgas each | The 17-step rope route minted 1 glass + 1 reed with score 10000 (value equals the best haul at docking prices); after two sales and one buy the account holds 5 Shells and 1 reed, matching the contract arithmetic. 100 Tgas prepaid needs about 0.1 NEAR of balance (a 0.1 NEAR account was refused), so the UI's trade gas was lowered to 30 Tgas. Earlier faucet runs also recorded storage `GLhCCAWEA5Nd7Q7m8iUaGsik4UVcbCv2wKs8pLXBZm8k`, claim `FfPPx4LpARtMzk7eXGGHKYvo4uFJpCrSy4aG9K6TKX79`, sell `59PzZGPQ8mJf11edrpfqK3gZkE8dRNcdWmvi2qr2TmYu`, then a script buy refused with ERR_SHELLS (3 Shells could not pay 4). No wish yet: the test account owns no pet. |
| 2026-11-14 | Season 2 UI review fixes; rebased onto `main` (#3–#5); release build carries `VITE_SEASON2_ENABLED` | `bun run typecheck`; `bun run test` 289 pass/17104 assertions; `cargo test --workspace` 182 passed/0 failed/3 ignored; `make build`, `make browser`, `make evidence`, `make break` (now also `familiar-season`: 27 season `break_` tests) ok; `bun run test:season-browser` passed at 390×844 and 1440×900 on 14 Nov UTC (a Beacon Court day); `test:records-browser` passed (one earlier run exited 1 with every check printed as passed and no error; four reruns exited 0). `VERCEL_ENV=production PRIVY_APP_ID=localcheck bun --no-env-file scripts/build-release.ts` with `VITE_SEASON2_ENABLED=true` emits `SeasonBram-*.js` containing the season screens; without the flag, or with `yes`, no season chunk or season strings are in `.vercel/output/static/assets` | Second ledger deposit refused before sending (`get_account` read at final); refusals before sending show the controller's own words (`SeasonNotSent`); wish form hidden without Mochi; buttons stay focusable with `aria-disabled` and focus returns to the status line; the device preview rolls over each day like the contract. Release flag follows the sealed note: production only, Privy app present, exactly `true`. The lazy season import is now behind the flag, so builds without it leave the screens out. The key line's signer-action list names the six season calls. Not deployed; no Vercel env change; nothing signed. |

## Recorded discrepancies (NEAR AI, 2026-11-13)

Expand Down
10 changes: 10 additions & 0 deletions contracts/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["common", "rules-export", "root", "pet", "items", "bakery", "market", "mock-pool"]
members = ["common", "rules-export", "root", "pet", "items", "bakery", "market", "mock-pool", "season"]

[workspace.dependencies]
near-sdk = { version = "=5.30.0", features = ["legacy", "global-contracts"] }
Expand Down
16 changes: 16 additions & 0 deletions contracts/season/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "familiar-season"
version = "0.1.0"
edition = "2024"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
near-sdk.workspace = true
familiar-common.workspace = true

[dev-dependencies]
near-sdk = { workspace = true, features = ["unit-testing"] }
near-workspaces = "=0.24.0"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
1 change: 1 addition & 0 deletions contracts/season/fixtures/best-haul.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content_version":"first_light_v1","area":"beacon","tools":[{"tool":"rope","hauls":[[1,1],[0,2]]},{"tool":"lantern","hauls":[[1,2]]}]},{"content_version":"first_light_v2","area":"beacon","tools":[{"tool":"rope","hauls":[[1,1]]},{"tool":"lantern","hauls":[[1,1]]}]}]
1 change: 1 addition & 0 deletions contracts/season/fixtures/pricing-cases.json

Large diffs are not rendered by default.

Loading