56 Commits
Author SHA1 Message Date
waozi 8854464571 Prove legacy peer headers, match Go metrics, and sandbox the service
Mesh CI and deploy / checks (push) Successful in 37m19s
Mesh CI and deploy / native (push) Successful in 17m28s
Mesh CI and deploy / scans (push) Successful in 4m37s
Mesh CI and deploy / container (push) Skipped
Mesh CI and deploy / deploy (push) Successful in 1m47s
The native pull client sent both X-Mesh-Node-* and X-Daochi-Node-*
signatures but nothing tested the legacy pair. A fixture peer now accepts
only the Daochi names and verifies ID, Time, Nonce and Signature against
the pulling node's paired key.

Native route labels used {reference}, {id} and {path} where Go writes
{recipient}, {receipt_id} and the bare collection prefixes, and native had
no referral rows. Both sides now emit the same 129 labels, and a parity
test fails on any family name, type or label mismatch.

mesh.service ran as root with ProtectSystem=no. Installs now create a
dedicated mesh account, hand it the data directory, let it read root-owned
configuration through its group, and install a drop-in with
NoNewPrivileges, ProtectSystem=strict, ReadWritePaths and PrivateTmp.
Rollback restores the recorded ownership and the previous drop-in.
2026-11-23 16:43:20 -03:00
waozi 58f341dbf8 Switch signed-message domains to mesh-* with 1-year legacy daochi-* fallback 2026-11-22 04:10:02 -03:00
waozi 82940cd9f0 Native Linux Mesh server with WAL PRAGMAs, unlocked crypto/sync, and key-delete buffer wipe 2026-11-22 02:54:39 -03:00
waozi cef032e837 Support verified Telegram Stars Dew purchases 2026-11-19 22:23:43 -03:00
waozi fc00726c09 Reply to linked Lumi Telegram messages 2026-11-19 00:36:52 -03:00
waozi 8566e4cf1b Relay signed owner Lumi developer turns 2026-11-18 22:41:51 -03:00
waozi 35159302be Rename Daochi to Mesh with compatible state and deployment migrations 2026-11-17 14:57:07 -03:00
waozi 37f79b047f Offer hosts only package releases they can run, keep every archive, serve WebAssembly variants
A host naming zx=R gets only releases whose stored .zx header has revision R.
A host naming host_api without a revision (every released host) gets only
revisions before 28, and oldest_host_api excludes releases built for an
interface the host no longer runs. format=wasm serves a release's signed
WebAssembly variant (release-SEQUENCE.wasm.json beside SHA.wasm) as
application/wasm.

Package staging no longer deletes archived releases or blobs. The history
keeps the newest release of every format, ZX revision and interface plus
the newest ten, up to the 64 the node reads.
2026-11-16 02:37:10 -03:00
waozi d9ef30ca13 Keep passkey copies and find accounts from Google
This is the passkey and Google half of the sign-in work. A passkey copy is
sealed on the device and released for its proof. A linked Google account only
names the account, through a keyed hash of its subject, on nodes that set
DAOCHI_GOOGLE_SIGNIN_CLIENT_IDS. Removing either has no conditions. The Entity
site origins join the allowed list.
2026-11-01 20:50:18 -03:00
waozi 467fd3ff66 Keep password-sealed account backups on the node
The node stores backup text sealed on the device and a digest of the login
proof, releases the text for that proof, and answers unknown accounts as it
answers wrong passwords. This is the account backup half of the sign-in work;
passkey copies and Google lookup follow in their own commit.
2026-11-01 20:50:18 -03:00
waozi 2a29f2d544 Keep Island unlock API documentation readable 2026-11-01 17:43:23 -03:00
waozi 77cae827db Add confirmed Shovey Island Dew unlock and launch pricing 2026-11-01 17:36:35 -03:00
waozi 90630564c5 Require consecutive check-in days for Wurm's daily Dew
A missed UTC day starts the count over, so a daily reward cannot be claimed after a gap however many days came before it.
2026-11-01 12:00:30 -03:00
waozi 4242e371b5 Harden sessions, payment reconciliation, mesh quotas and release security gates 2026-10-30 21:11:12 -03:00
waozi 7214c30d3d Let private nodes keep trashed blobs
DAOCHI_TRASH_PURGE_DAYS sets how long a blob stays in an account's trash before the node deletes it: 30 days by default, as on the public node. A private node that archives its owner's photos sets 0 and keeps them, while trashed blobs still stop counting toward storage.
2026-10-29 15:43:42 -03:00
waozi d862a34f80 Hold deleted accounts for 30 days and stop charging deleted data
Deleting a sync account now moves every row it owns, found through the
schema's ON DELETE CASCADE keys, into <db>.held/<account>.db and its blob
files beside it. The live tables keep nothing, so it stops syncing, counting
toward storage and appearing to others at once. A login with "restore": true
brings it back during the hold; a plain login starts an empty account and
reports held_until. The retention job deletes holds after 30 days.

Deleted records drop their content as the deletion arrives and cost nothing,
and a deletion wins an equal-time mesh tie. Blobs can be moved to and from
the trash with POST .../trash and .../restore: trashed blobs stay readable,
cost nothing and are deleted after 30 days. Deploy backups are pruned at 28
days so no copy outlives the 30-day window.
2026-10-29 13:39:55 -03:00
waozi 651cfda821 Price new premium username claims in DEW 2026-10-28 15:43:48 -03:00
waozi aa0ed3d73b Pay Shovey's campaign reward by finishing place
Finishing all 175 levels now gives 100 Dew to the first 10 finishers,
50 Dew to the next 20, 20 Dew up to the 100th and 5 Dew after that,
instead of a flat 5 Dew.

- token_reward GiveByPlace counts earlier credits and credits the next
  place in one transaction, so two finishers never share a place; an
  account that claims again keeps its place and its Dew.
- Finishers credited the flat 5 Dew before this keep their places and get
  the rest of their place's Dew once at node start (SettlePlaces).
- GET /api/v1/rewards lists what the next claim gives; the claim answer
  includes the place.
2026-10-27 13:04:06 -03:00
waozi 4a03d74ca6 Preserve pre-upgrade Shovey reward progress with account-bound migration 2026-10-26 14:22:14 -03:00
waozi 0311a496f9 Require synced completion evidence for game rewards 2026-10-25 14:01:46 -03:00
waozi dd00d52ce8 10,000 Dew = 1 XMR: every balance, price and reward ten times larger
The owner moved Dew from 1000 to 10,000 per XMR, so everything in Dew
grows tenfold and keeps its Monero value.

- Prices: Tai Chi 100 Dew (60 during the trial), storage 20/200 Dew for
  1 GB and 60/600 Dew for 5 GB a month/year; Shovey's secret chest gives
  2 Dew and finishing the campaign 5 Dew.
- Rescales are named: `daochi rescale-dew NAME FACTOR`, so a later ratio
  change can rescale again (rescale-v1 was 5 to 100 Dew per XMR).
- `daochi dew-ratio NAME ATOMIC UNITS` raises the node's ratio by a whole
  factor: it rescales Dew once and prints the new MONERO_RATE_* and the
  scaled DAOCHI_TOKEN_PRODUCTS for the environment.
- The deploy reads the production ratio from deploy/dew-ratio.env
  (10,000 Dew per XMR, rescale-v2) and applies it with the service
  stopped; a failed step or health check restores the previous binary,
  database and environment together.
2026-10-24 23:53:10 -03:00
waozi 014dc5fa8a Game rewards the node gives once per account; Dew gifts paused
POST /api/v1/rewards claims a game reward for the bearer's account. The
node keeps the catalog, shovey.secret-chest at 0.2 Dew and
shovey.campaign-complete at 0.5 Dew; the client names only the reward and
cannot set an amount. Claims go through token_reward.Give, a signed credit
whose payment ID is the reward and the account, so a reward credits an
account once however often it is asked for; repeats answer credited false
with the balance. GET lists the rewards.

Anyone can open accounts and claim rewards with each, so Dew gifts between
accounts are refused (403 gifts are paused) unless DAOCHI_DEW_GIFTS_ENABLED
is set. Dew cannot be exchanged back to Monero.
2026-10-24 20:07:27 -03:00
waozi 693dd9c8a0 Let accounts delete blobs they no longer use and store entity content in chunks 2026-10-23 22:37:55 -03:00
waozi 25c57f7f70 Serve ZX portable executables to ZX hosts and keep legacy ZIB releases for older ones 2026-10-23 21:00:48 -03:00
waozi 110d938bac Let people publish level collections for others to find and play
POST /api/v1/publications publishes a collection of custom game levels: a
format, a title, a JSON document of up to 256 KiB and a visibility of
public, friends or private. Sending its id replaces one of your own, while
anyone else's answers 404 so a publication's existence never leaks. An
account keeps at most 100 publications and their documents count toward its
storage.

GET /api/v1/publications lists the newest public publications, or with
author (an alias or account ID) the ones that author lets you see: public
ones, friends-only ones for friends, and private ones for the author alone.
Either listing can keep one format. GET /api/v1/publications/{id} returns a
visible publication with its document, and DELETE lets its author
unpublish it. Publishing is limited to 60 changes an hour and reading to 120
requests a minute per account.
2026-10-19 15:02:08 -03:00
waozi fa98f4f6d2 Quote each feedback reply's report title for apps
Apps show a developer's reply like a chat reply, quoting the feedback it
answers. The replies page now carries the report's title (still without
its message or diagnostics) for the single reply and for added replies.

Also bring testdata/package_paths.json up to date with the history asset
described in c80d978, which the OpenAPI baseline test compares.
2026-10-18 22:33:10 -03:00
waozi bbf655ddae Let a feedback report carry several developer replies
A developer reply replaced the report's single reply, so a second reply
overwrote the first and apps that had shown the first never showed the
second. A reply sent with its own 64-character reply_id is now added
beside the report's earlier replies in a new table, and retrying the same
reply_id and text adds nothing, while reusing a reply_id for other text is
refused. A reply without reply_id keeps its single-reply behavior.

Lumi's reply list returns every reply once, oldest first, each under its
own ID (the report's ID for the single reply), so released Inner Breeze
versions show every reply in order without an app update. Report lists show
each report's latest reply, replies leave with their report, and
scripts/feedback.py takes --reply-id.
2026-10-17 18:24:09 -03:00
waozi 27d882bbe8 Take the free storage allowance from the node's configured limit
The free plan was a fixed 10 MiB in code. It is now the node's
DAOCHI_ACCOUNT_STORAGE_LIMIT_BYTES, both as the allowance after a paid
plan ends and as free_bytes in GET /api/v1/storage/plan, so changing it
needs only a configuration change.
2026-10-17 01:31:16 -03:00
waozi 87a7c9ee20 Let accounts gift Dew to their friends
POST /api/v1/tokens/gifts sends Dew to an accepted friend: the sender's
signed debit and the friend's signed credit commit in one transaction,
both with source_type gift and the other account as source_ref. A gift to
oneself, above the balance or to someone who is not a friend is refused
and moves nothing. The request ID makes retries safe: repeating it never
sends twice and answers with the first result even after the friendship
ends, and the same ID with another recipient or amount is refused (409).
2026-10-16 02:51:34 -03:00
waozi 529e651401 Price storage at 2 Dew a month for 1 GB and 6 Dew for 5 GB 2026-10-15 23:57:35 -03:00
waozi bd649800e4 Serve a public XMR/USD display rate from agreeing public sources
GET /api/v1/rates returns US cents per XMR, its age, the agreeing sources
and the node's fixed Dew funding ratio, so apps can show what Dew is worth.
Every ten minutes the node reads CoinGecko, Kraken and CoinPaprika, drops a
source more than 10% from the median and keeps the median of at least two
that agree; the rate is stored for restarts and hidden after two hours.
It is display only and never sets a price, charge or credit.
2026-10-15 16:04:11 -03:00
waozi fb9c51b291 Sell 1 GB and 5 GB storage plans and price Dew at 1000 per XMR
The owner set 1 Dew = 0.001 XMR. Balances are not rescaled; only prices
change, keeping each purchase's XMR price.

- Storage plans come in two sizes: 1 GB for 200 Dew a month or 2000 a
  year, 5 GB for 600 Dew a month or 6000 a year. The free allowance stays
  10 MiB.
- GET /api/v1/storage/plan adds free_bytes, plans[] with each size's Dew
  and XMR prices, and plan.size. The top-level prices stay the 1 GB plan's
  for apps that predate sizes.
- POST takes an optional size (1gb when missing). Buying the current size
  extends it; buying the other size starts now and converts the unexpired
  time at the monthly price ratio. Reusing a request ID for another size
  or period is refused.
- Existing plans and purchases migrate to 1 GB through a new size column.
- Tai Chi costs 10 Dew, 1 Dew during the launch offer.
2026-10-15 15:33:30 -03:00
waozi 35a9280316 Publish unlock prices so the app shows the offer before sign-in
GET /api/v1/unlocks/products returns the node's current prices and
trial end without authentication, the same products list the account
route returns, so Inbe can show Tai Chi's crossed-out regular price and
the trial price to people who have not signed in yet.
2026-10-15 13:04:38 -03:00
waozi ab3a8070c8 Sell server-priced unlocks, gate their packs with grants, and scale Dew
The owner set 100 Dew = 1 XMR (from 5) and made Inbe's Tai Chi a paid
practice whose price and discounts the node enforces.

- Unlocks: GET/POST /api/v1/unlocks list and buy products at the node's
  price; the client names only the product. Tai Chi costs 1 Dew, 90% off
  before DAOCHI_UNLOCK_TRIAL_UNTIL. The signed debit and the unlock row
  commit together, and a repeat unlock charges nothing.
- Grants: POST /api/v1/unlocks/grant signs a one-hour grant for an
  unlocked product with the Dew issuer key, prefixed so it can never
  match a receipt or checkpoint signature.
- Gated packs: an artifact with a node-side <sha>.zib.product file is
  served only at <sha>.zib/<grant> with a valid grant for that product,
  as private, no-store; unreadable markers stay gated, and the v1
  package route refuses gated artifacts.
- Storage plans cost 20 and 200 Dew, keeping their XMR price at the new
  rate.
- `daochi rescale-dew 20` adds signed credits to existing balances and
  scales uncredited invoices and deposits once, then signs a checkpoint.
2026-10-15 12:46:23 -03:00
waozi a5a889bfe1 Price prepaid storage directly in Monero 2026-10-15 01:38:33 -03:00
waozi fbd6c2b78e Add accepted friend invitations and shared list collaboration 2026-10-15 01:17:31 -03:00
waozi 480a6affab Add Dew credit and prepaid storage plans 2026-10-15 01:15:56 -03:00
waozi 81ea61c998 Deliver slow Lumi answers and accept up to 64 app tools
Lumi's chat, spelling and habit-icon answers can take as long as the node
waits for the model: 35 seconds, or 60 for spelling. The node's 15-second
write timeout cut those answers off, so the app never received them. These
routes now keep the response open for the model's wait plus 15 seconds;
every other route keeps its 15 seconds.

Inner Breeze now offers exactly 32 tools, the old maximum, so a chat
request may now carry up to 64.
2026-10-13 19:22:07 -03:00
waozi 17994f92f9 Choose habit icons with the node's GLM service
POST /api/v1/chat/habit-icons lets Inner Breeze give an icon to habits
that have none of their own. The app sends its icon names (1 to 64
distinct names of lowercase letters, digits and underscores) and up to
32 habits with a name and an optional description. The node answers with
one entry per habit, in order: an offered icon name that obviously fits
the habit, or "" when none clearly fits. Names the model invents are
dropped, so the app only ever receives icons it has.

Like spelling correction, each request uses one unit of the same daily
account and node allowance as Lumi's chat, invalid requests are refused
before they reach the provider or spend the allowance, and habits and
answers are neither stored nor logged. Habit names and descriptions are
data for the model, never instructions.

The committed Go of a few unchanged sources is regenerated so that it
matches the current compiler output again.
2026-10-12 14:30:05 -03:00
waozi e24aa56d1c Correct the spelling of diary entries with the node's GLM service
POST /api/v1/chat/spelling takes one text of up to 8192 bytes and returns
it with only misspelled words corrected. The model sees the text without its
surrounding blank space, which is restored exactly around the correction,
and is told to keep wording, punctuation, line breaks and Markdown as they
are. Each request uses one unit of the same daily account and node
allowance as Lumi's chat, and the text is neither stored nor logged.

Chat and spelling now share the account check, the allowance and the
provider call, and spelling gets a longer timeout and output budget because
a corrected entry is about as long as the entry.
2026-10-10 23:00:21 -03:00
waozi 8ec9fc4f04 Document the package route's interface and rollout parameters 2026-10-10 20:47:00 -03:00
waozi 9859f1d1b6 Add LAN-only apps, node-local blobs and an embeddable node core
Apps can be registered as LAN-only with their allowed networks and
registration node, and a node can limit which accounts it syncs. Private
immutable ciphertext blobs stay on their node and are served over HTTP;
mesh exports carry only records. The node core can be embedded by an app
whose host supplies storage, transport and supervision. The OpenAPI
docs, mesh policy and tests follow, and the Wrangler cache is ignored.

This is the orphaned work from 2026-10-08; it builds and the Go tests
pass.
2026-10-10 20:28:35 -03:00
waozi 35a0703552 Add device link paths to the OpenAPI baseline
The docs baseline tests compare the served spec with fixtures, so the three
device link paths need theirs.
2026-10-10 18:30:28 -03:00
waozi 72b98b1e8b Keep Lumi Telegram input-only for current and older apps 2026-10-09 01:24:47 -03:00
waozi 990fc185bb Match chat OpenAPI fixture to the 32-tool limit 2026-10-09 01:21:08 -03:00
waozi f852f2e9fa Complete verified Telegram connect rendezvous and bounded delegated reads 2026-10-08 02:14:28 -03:00
waozi ee84c41d11 Verify Telegram account entries and share atomic replay protection 2026-10-08 01:45:07 -03:00
waozi a80bd5704f Authorize scoped key-bound sessions and consume Telegram links atomically 2026-10-08 01:09:25 -03:00
waozi f050a8a784 Keep feedback API contract fixtures account-scoped 2026-10-07 01:08:19 -03:00
waozi 5c1c2f3a4f Add node-hosted Lumi chat and account-scoped app feedback 2026-10-07 01:03:12 -03:00