Skip to content

feat(cli): decdn dashboard and the gateway's GET /_status, with metrics on every gateway - #2637

Merged
thiras merged 26 commits into
mainfrom
feat/gateway-dashboard
Oct 27, 2026
Merged

thiras merged 26 commits into
mainfrom
feat/gateway-dashboard

Conversation

@thiras

@thiras thiras commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

A new command, decdn dashboard, serves one local page of what this host does with deCDN: its decdn get pulls, its gateway, and its node. decdn gateway gets the GET /_status endpoint that feeds the gateway section, and metrics on every gateway. The gateway serves no page itself.

  • decdn dashboard serves the Vite page on 127.0.0.1:8485 (--listen, loopback only). The dashboard process reads every source, and the page reads only the dashboard's own same-origin GET /_status. The page has three sections:

    • Pulls (whenever the home directory is known): the decdn get runs on the host. Live runs show progress, files landed and what they have paid so far; finished runs show their outcome, size, duration, what they paid and to how many nodes.
    • Gateway (when one answers): the gateway's /_status at --gateway (default http://127.0.0.1:8484). The token comes from --gateway-token-file (default ~/.decdn/gateway/token) and is re-read on every poll, so a gateway that starts after the dashboard is picked up. The token goes to a loopback --gateway only, and the dashboard follows no redirect.
    • Node (when one runs): health, status, the node top metrics, lanes, earnings, buyer pools and slashes, from the admin RPC and /metrics. The URLs resolve exactly as decdn node status and decdn node top resolve them. Each read has its own result. A read the node isn't set up for (no slash detection, buyer pool, settlement ledger or DHT) shows as "not configured", not as an error.
    • Polling: each source is read at a fixed rate however many tabs are open. Pull records are read every 1 s, the gateway every 2 s, the node's health, status and metrics every 2 s, and its lanes, earnings, pools and slashes every 15 s (lanes can read the chain; earnings reads the whole settlement ledger).
    • Read-only: no route changes a source.
  • Pull records: every decdn get (except --dry-run) writes ~/.decdn/activity/pulls/<start-ms>-<pid>.json, whatever its --data-dir, and rewrites it every second through a temp file and a rename.

    • Blob runs feed it through a progress tee on BlobFetch. Bundle runs feed it through PullObserver and a teeing FileObserver, which keeps each blob's last position because a blob reports its whole position each time.
    • What the run paid comes from ReceiptEvidence::lanes() every 5 s, and from the receipt summary at the end.
    • A run that can't write its record still pulls, and warns once. A running record whose heartbeat is older than 10 s shows as "stopped without a summary" (a second Ctrl-C exits at once and writes nothing). Each run prunes the directory to the newest 200 records.
  • GET /_status on the gateway returns the gateway's state as one JSON document:

    • the request counters and the pulls in flight (hash, payer, age, bytes delivered);
    • the registered capabilities;
    • a public gateway's allowance buckets and namespace pointers;
    • what the buyer-pool store holds: pools with deposit, spend and lanes, plus each capability key's own lanes.

    The pull worker reads the store, because redb refuses a second open in the same process.

  • Where the gateway's /_status answers:

    • On a loopback gateway's own host, behind the gateway token. / is the short page, which now names decdn dashboard.
    • On --metrics-listen, which now works on every gateway, not only public ones. It serves /metrics and /_status. On a public gateway /_status takes no token there; on a loopback gateway it takes the gateway token.
    • The listener answers only its own loopback names in Host, and a non-loopback address is refused when the flag is parsed.
    • A public gateway's public host serves none of it.
  • Metrics: every gateway now counts its requests. Polls of /_status on a loopback gateway's own host are not counted.

  • The page is a Vite + React + Tailwind v4 app in crates/cli/dashboard/.

    • It builds to three fixed files, which crates/cli/build.rs embeds in the binary.
    • Without a Node build, the binary embeds a page that says how to build it, so cargo build needs no Node. No release can ship that page.
    • The page runs under a strict CSP: script-src 'self'; style-src 'self'; connect-src 'self', with no inline script or style.
  • Shared loopback plumbing: the token, Host-check and response helpers move from gateway.rs to commands/local_http.rs, which the gateway and the dashboard both use.

  • Packaging: decdn-cli lists its packaged files in include, so that the gitignored dashboard/dist/ reaches the .crate.

    • Cargo counts those gitignored files as uncommitted, so packaging and publishing now need --allow-dirty.
    • Before each of those steps, check-dashboard-packaged.sh proves the rest of the checkout is clean, and that the .crate carries the build and no other untracked file.
    • The package-embeds guard learns about OUT_DIR embeds and [package].include.
  • CI and release:

    • A new dashboard job runs lint, typecheck, tests and the build, and checks the build is exactly the three files.
    • The packaging job and release verify build the page before packaging.
    • build-binaries builds it on every runner and refuses a decdn binary that embeds the fallback page.
    • publish-crates.sh builds it too, running pnpm from PATH or through corepack.

The design is in adr/appendix-binaries.md § Dashboard and adr/appendix-gateway.md § State.

Breaking

  • Admin wire: BuyerPoolSnapshot gains a required spent_micro_usdc. A decdn CLI from this release reads admin_v1_pools only from a daemon of the same release.
    • decdn node pools and decdn pool list gain a SPENT column before LANES, which moves LANES one column right.
    • The builder of this response moves from decdn-node into decdn-incentive (From<BuyerLoad>), and the node and the gateway share it.
  • --metrics-listen answers only a loopback Host. This includes /metrics. A scraper must address the listener as 127.0.0.1:<port>, localhost:<port>, [::1]:<port> or the listen address. A non-loopback address is refused when the flag is parsed.
  • decdn gateway's startup output ends with see it with: decdn dashboard instead of a link. The TypeScript SDK never reads /, /_status or the startup output, so no sdk-typescript PR is needed.
  • decdn get writes to ~/.decdn/activity/pulls/ on every run that isn't a --dry-run.

Reviewer notes

  • Read first:
    • crates/cli/src/commands/dashboard.rs, dashboard/sources.rs and dashboard/status.rs: the server, the pollers and the body.
    • crates/cli/src/commands/activity.rs: the pull record. Then its hooks in get.rs, receipt.rs (finish_get now returns the receipt summary too), fetch.rs and bundle_pull.rs.
    • crates/cli/src/commands/gateway/status.rs, and in gateway.rs: operator(), operator_request(), public_bare(), serve_metrics() and the PullGuard / active-pull registry.
  • Contracts pinned to fixtures in crates/cli/dashboard/src/fixtures/, written by Rust tests (UPDATE_STATUS_FIXTURES=1 cargo nextest run -p decdn-cli status::) and checked against api.ts by contract.test.ts:
    • status-*.json: the gateway's /_status.
    • dashboard-*.json: the dashboard's /_status. Its gateway.status is a stand-in that names the gateway fixture, so neither contract's update run depends on test order; the page's tests splice the gateway fixture in.
  • Unchanged on purpose: GET /_capability stays byte-identical. The new Capability struct declares its fields in sorted key order, and the_capability_list_keeps_its_shape pins the body.
  • Security:
    • The browser never reaches the gateway or the node's unauthenticated admin port: the dashboard process reads them and the page reads only its own origin. The gateway grants no cross-origin read.
    • The dashboard's /_status takes its own token (~/.decdn/dashboard/token), because the page shows earnings and pool balances. The token travels in the printed link's #fragment, which never reaches the server or a log. The page moves it to sessionStorage and strips it from the address.
    • The dashboard answers GET only, refuses a foreign Host with 403, and sends no CORS headers. On a loopback gateway, OPTIONS /_status answers 403.
    • Site origins return 404 for /_status.
  • A gateway on another host is read through an SSH tunnel to its --metrics-listen, with the same port on both ends: the listener refuses a Host other than its own port.
  • Known follow-ups, not in this PR:
    • The embed guard's include() matcher does not handle every .gitignore pattern (/src, dir/, * across /). None is in use today.
    • Store-read failures appear only in /_status, not in the log.
    • An ActivePulls wrapper type for the registry.
  • Risk:
    • The binary grows by about 250 KB.
    • Every published crate's .cargo_vcs_info.json records dirty: true, because of --allow-dirty.

Review fixes (3a9e632e)

A five-agent review of f0356974 (code, silent failures, tests, comments, types) found these, all fixed:

  • A finished run could revert to running. ActivityRecorder::finish aborted the heartbeat without waiting for it, so a write already in flight on another worker could land after the final one. It now awaits the aborted task.
  • The gateway token could reach a remote host. --gateway takes any URL and the client followed redirects with the custom header. The token now goes to a loopback host only, and the client follows no redirect.
  • One bad gateway body blanked the page. Each section draws inside its own error boundary, and the gateway body's shape is checked before any gateway panel draws.
  • A pool replacement double-counted bundle progress. A blob's position is keyed by its first path, so the second pass counts it once.
  • Failures were mislabelled or hidden.
    • Only a refused connection reads as no gateway or no node.
    • Errors keep their whole cause.
    • A named token file that can't be read is an error naming it.
    • The first failed heartbeat write warns.
    • An unlistable pulls directory is an error, not "no pulls".
    • A dead poller, a failed prune and a failed accept are each logged; a failed accept no longer stops the dashboard.
    • A section whose last read is three polls old is marked on the page.
    • A node whose health read failed still shows its other reads.
  • Types: a record's state carries its end and error, bundle counts land with the run's end, the node's error state carries its message, and a node read has a timestamp only once it is made.
  • Docs: ADR, CHANGELOG and doc-comment wording corrected, and the pnpm dev proxy sends the dashboard's Host (changeOrigin: true).
  • Tests added:
    • the bundle observer feeding the record, including a blob started twice;
    • the heartbeat writing a live run;
    • every end state, including Ctrl-C reported through added context;
    • per-node merging and prune-on-start;
    • the node's up/absent/error mapping, the per-poll token re-read, loopback-only tokens and redirects not followed;
    • a third pinned fixture with failing sources (dashboard-failing.json).

Not changed: the bundle-only record fields stay beside kind rather than inside it (rated optional), and no anvil test covers progress on a -o - run.

Verification

Run on the current head (3a9e632e):

  • Pre-commit hooks on every changed file: all pass. cargo deny reports two existing advisories (crypto-bigint, ctutils); that hook reports without blocking, and Cargo.lock is unchanged.
  • cargo clippy -p decdn-cli -p decdn-common -p decdn-e2e --all-targets --all-features -- -D warnings: clean. CARGO_BUILD_WARNINGS=deny cargo doc -p decdn-cli -p decdn-common -p decdn-e2e --no-deps --document-private-items: clean.
  • cargo nextest run -p decdn-cli -p decdn-common -p decdn-e2e: 1689 passed.
  • cargo nextest run -p decdn-e2e --features anvil-e2e -E 'binary(gateway_public) | binary(cli_fetch_two_data_dirs)', on freshly built binaries: 2 passed.
    • gateway_public step 7 starts decdn dashboard against the live gateway's metrics listener and the node, and checks that the gateway and the node show as up with lanes and metrics, and that /_status refuses a request with no token. The metrics listener's / is now a 404.
    • cli_fetch_two_data_dirs checks that a real paid decdn get leaves a done record: the blob's bytes, exactly the wire bytes paid, and the one node paid.
  • pnpm -C crates/cli/dashboard test: 63 passed. The build is exactly the three files, and dashboard-lint.sh (eslint, prettier) passes.
  • make -C adr check-refs passes.
  • The PR title uses feat with a lowercase subject.

Run at f0356974, before the review fixes; not rerun since:

  • A smoke run with an embedded build and a throwaway HOME:
    • With nothing running, the gateway and node showed as absent. /_status without the token answered 401, and a foreign Host got 403.
    • With a loopback gateway started after the dashboard, the gateway showed as up.

Run at the previous head (f437e3e7), before the page moved to decdn dashboard; not rerun:

  • cargo nextest run --workspace (5882 passed) and pre-commit run --all-files.
  • cargo nextest run -p decdn-e2e --features anvil-e2e,sdk-e2e --test gateway_sdk against the pinned SDK commit 330e75b: 2 passed.
  • cargo publish --workspace --dry-run --locked --allow-dirty, and cargo package -p decdn-cli --list with and without dist/.
  • uvx --with pyyaml pytest .github/scripts/tests scripts/tests: 300 passed.

Not done: I have not opened the reworked page in a browser.

🤖 Generated with Claude Code

thiras and others added 19 commits October 27, 2026 00:51
…ntive, with the pool's spend

BuyerPoolsResponse is now From<BuyerLoad>, shared by admin_v1_pools and
the gateway. BuyerPoolSnapshot gains spent_micro_usdc (pool_spend()), and
both pool tables print a SPENT column.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…sten without --public-url

Metrics moves from Public to Gateway, and Metrics::snapshot() returns a
serializable Counters that render() reads through.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
/_status is one JSON read of the gateway: its counters, the pulls in
flight, the capabilities, a public gateway's allowance buckets and
pointers, and what the buyer-pool store holds (answered by the pull
worker, which owns the store). A loopback gateway answers it on its own
host behind the gateway token, and serves the dashboard at /. Every
gateway answers both on --metrics-listen with no token; a public
gateway's public host answers neither.

build.rs embeds the Vite build from crates/cli/dashboard/dist/, or a page
that says how to build it, so a build with no Node toolchain succeeds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
/_status on --metrics-listen takes no token, so a page whose name is
rebound to the listener's loopback address could read it. The listener
now answers only its own loopback names, as the main listener does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
React + Tailwind v4, built to three fixed files (index.html, app.js,
app.css) that build.rs embeds. No inline script or style, so the page
runs under the gateway's script-src/style-src 'self' policy; meters are
<meter> elements. The gateway token arrives in the link's #token=
fragment, moves to sessionStorage and leaves the address bar.

The package include anchors its root files: a bare README.md matched
every README under dashboard/node_modules/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A dashboard job lints, type-checks, tests and builds crates/cli/dashboard
and asserts dist/ is the three files the gateway embeds. packaging, the
release verify job and publish-crates.sh build it before packaging and
check that decdn-cli's .crate carries it; build-binaries builds it on
every runner and refuses a decdn binary that embeds the fallback page.
A pre-commit hook lints the app when its files change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cargo counts the dashboard's gitignored build, which decdn-cli packages
through include, as uncommitted, and refuses to package or publish.
Each site now proves git status is otherwise clean, then allows it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eave the dashboard's requests uncounted

On a loopback gateway, /_status on --metrics-listen now takes the gateway
token, as on its own host: the capabilities are the token holder's. The
dashboard's page, assets and /_status polls on a loopback gateway's host
no longer count as served or refused requests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
check-dashboard-packaged.sh now also fails on a git status error and on
any file in decdn-cli's .crate that git does not track beyond the
dashboard build, and runs before the packaging step in ci.yml, release.yml
and publish-crates.sh. The dashboard-lint hook skips, and says so, without
node_modules, so pre-commit run --all-files needs no Node.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n checked when parsed

Addresses in /_status are EIP-55 throughout and content hashes bare hex.
Rust tests pin a full /_status of each mode to the dashboard's fixtures.
--metrics-listen moves to GatewayArgs and refuses a non-loopback address
at parse time. The metrics listener is pinned same-origin and uncounted.
Docs: what 402 and refused count on a loopback gateway, and that deposit
less spend is at most the pool's headroom.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a stalled gateway

The token hand-off survives a browser that throws on reading session
storage, and the page says the token lasts until reload. A /_status read
gives up after 8 s, so a stalled gateway no longer shows as live, and a
body that is not a status is an error. contract.test.ts checks api.ts
against the fixtures the Rust tests pin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Metrics::render destructures Counters whole, so a series missing from
the exposition fails to compile. PullGuard::new takes the Payment and
derives its bucket and payer. One host_header helper replaces three
Host lookups; the allowance's day arithmetic is shared by remaining()
and view().

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras thiras self-assigned this Oct 27, 2026
Copilot AI balanced review requested due to automatic review settings October 27, 2026 14:04
@github-actions

Copy link
Copy Markdown

Gas snapshot

No gas changes vs base.

@github-code-quality

github-code-quality Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Rust, Solidity

Rust / code-coverage/cargo-llvm-cov

main da7c178 feat/gateway-dashboa... 2996a7a +/-
77% 77% 0%
View coverage of the 10 most impacted files.
File main da7c178 feat/gateway-dashboa... 2996a7a +/-
crates/cli/src/...ands/gateway.rs 77% 78% +1%
crates/cli/src/.../bundle_pull.rs 53% 55% +2%
crates/cli/src/...ull_progress.rs 71% 76% +5%
crates/cli/src/...ds/dashboard.rs 0% 30% +30%
crates/cli/src/...oard/sources.rs 0% 54% +54%
crates/cli/src/...nds/activity.rs 0% 88% +88%
crates/cli/src/...hboard/embed.rs 0% 90% +90%
crates/cli/src/...teway/status.rs 0% 97% +97%
crates/cli/src/...s/local_http.rs 0% 100% +100%
crates/cli/src/...board/status.rs 0% 100% +100%

Solidity / code-coverage/forge

main da7c178 feat/gateway-dashboa... 2996a7a +/-
92% 92% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 27, 2026 16:28 UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Status reporting and balance presentation have correctness gaps, and packaged status tests omit required fixtures.

4 open issues
1 file not reviewed
  • crates/cli/dashboard/pnpm-lock.yaml: Generated file
What changed in this PR

Adds an embedded operator dashboard to decdn gateway, backed by GET /_status and metrics available on both loopback and public gateways.

Changes:

  • Adds status reporting for requests, active pulls, capabilities, allowances, pointers, and stored payment lanes.
  • Builds a React dashboard with token authentication, polling, and shared Rust/TypeScript fixtures.
  • Updates packaging, release checks, documentation, and tests to support embedded dashboard assets.
File Description
scripts/​publish-crates.sh Builds and checks dashboard assets before publishing.
RELEASING.md Documents dashboard publishing prerequisites.
docker/​README.decdn.md Documents operator routes and Host restrictions.
crates/​node/​src/​admin/​tests.rs Moves snapshot conversion tests to incentive.
crates/​node/​src/​admin.rs Uses shared buyer-pool snapshot conversion.
crates/​incentive/​src/​buyer_pool/​tests.rs Tests snapshot ordering, amounts, and spend.
crates/​incentive/​src/​buyer_pool.rs Adds shared pool and lane snapshot conversion.
crates/​e2e/​tests/​gateway_public.rs Checks status, metrics, and dashboard integration.
crates/​common/​src/​cli/​gateway/​tests.rs Tests metrics listener parsing and loopback restrictions.
crates/​common/​src/​cli/​gateway.rs Makes the metrics listener available in both modes.
crates/​common/​src/​admin/​tests.rs Updates snapshot serialization coverage.
crates/​common/​src/​admin.rs Adds recorded spend to buyer-pool snapshots.
crates/​cli/​src/​commands/​pool/​tests.rs Tests the new SPENT column.
crates/​cli/​src/​commands/​pool.rs Displays recorded pool spend.
crates/​cli/​src/​commands/​gateway/​worker/​tests.rs Tests concurrent and stopped-worker snapshot queries.
crates/​cli/​src/​commands/​gateway/​worker.rs Reads pool snapshots through the existing worker.
crates/​cli/​src/​commands/​gateway/​tests.rs Covers status access, metrics, and dashboard routing.
crates/​cli/​src/​commands/​gateway/​status/​tests.rs Pins serialized status fixtures.
crates/​cli/​src/​commands/​gateway/​status.rs Gathers the status document with bounded store reads.
crates/​cli/​src/​commands/​gateway/​pointer/​tests.rs Tests ordered pointer snapshots.
crates/​cli/​src/​commands/​gateway/​pointer.rs Exposes held pointers for status reporting.
crates/​cli/​src/​commands/​gateway/​metrics/​tests.rs Checks JSON and Prometheus counter agreement.
crates/​cli/​src/​commands/​gateway/​metrics.rs Adds serializable counter snapshots.
crates/​cli/​src/​commands/​gateway/​dashboard/​tests.rs Checks embedded assets and security headers.
crates/​cli/​src/​commands/​gateway/​dashboard.rs Serves embedded dashboard files under a strict policy.
crates/​cli/​src/​commands/​gateway/​allowance/​tests.rs Tests allowance snapshots and daily resets.
crates/​cli/​src/​commands/​gateway/​allowance.rs Exposes ordered allowance bucket views.
crates/​cli/​src/​commands/​fetch.rs Exposes the host’s store and deployment.
crates/​cli/​README.md Introduces the gateway dashboard.
crates/​cli/​dashboard/​vite.config.ts Configures fixed build assets and development proxying.
crates/​cli/​dashboard/​tsconfig.json Configures strict TypeScript checking.
crates/​cli/​dashboard/​src/​view.ts Derives dashboard rows and usage indicators.
crates/​cli/​dashboard/​src/​view.test.ts Tests panel calculations.
crates/​cli/​dashboard/​src/​token.ts Handles token fragments and session storage.
crates/​cli/​dashboard/​src/​token.test.ts Tests token handling and blocked storage.
crates/​cli/​dashboard/​src/​main.tsx Mounts the React application.
crates/​cli/​dashboard/​src/​index.css Defines themes and usage-meter styling.
crates/​cli/​dashboard/​src/​format.ts Formats amounts, counts, durations, and hashes.
crates/​cli/​dashboard/​src/​format.test.ts Tests display formatting.
crates/​cli/​dashboard/​src/​fixtures/​status-public.json Pins a public gateway status example.
crates/​cli/​dashboard/​src/​fixtures/​status-pool-error.json Pins a store-error status example.
crates/​cli/​dashboard/​src/​fixtures/​status-loopback.json Pins a loopback gateway status example.
crates/​cli/​dashboard/​src/​contract.test.ts Checks status fixtures against frontend types.
crates/​cli/​dashboard/​src/​components/​TokenForm.tsx Adds manual token entry.
crates/​cli/​dashboard/​src/​components/​StatTiles.tsx Displays request and transfer counters.
crates/​cli/​dashboard/​src/​components/​Pools.tsx Displays pool balances and payment lanes.
crates/​cli/​dashboard/​src/​components/​Pointers.tsx Displays namespace pointers.
crates/​cli/​dashboard/​src/​components/​Panel.tsx Provides shared panels, tables, and meters.
crates/​cli/​dashboard/​src/​components/​Header.tsx Displays gateway identity and connection state.
crates/​cli/​dashboard/​src/​components/​Capabilities.tsx Displays capability usage and expiry.
crates/​cli/​dashboard/​src/​components/​Allowance.tsx Displays daily allowance usage.
crates/​cli/​dashboard/​src/​components/​ActivePulls.tsx Displays active transfers.
crates/​cli/​dashboard/​src/​App.tsx Coordinates authentication, polling, and panels.
crates/​cli/​dashboard/​src/​api.ts Defines status types and timeout-aware fetching.
crates/​cli/​dashboard/​src/​api.test.ts Tests status fetching and failures.
crates/​cli/​dashboard/​README.md Documents dashboard development and fixtures.
crates/​cli/​dashboard/​package.json Defines dashboard dependencies and commands.
crates/​cli/​dashboard/​index.html Adds the dashboard HTML entry point.
crates/​cli/​dashboard/​eslint.config.js Configures linting and disallows inline style props.
crates/​cli/​dashboard/​.prettierrc.json Enables default formatting rules.
crates/​cli/​dashboard/​.prettierignore Excludes generated files and pinned fixtures.
crates/​cli/​dashboard/​.npmrc Enforces the Node engine requirement.
crates/​cli/​Cargo.toml Explicitly includes dashboard build assets in packages.
crates/​cli/​build.rs Embeds built assets or a fallback page.
CONTRIBUTING.md Documents dashboard tooling and hooks.
CLAUDE.md Documents dashboard ownership and build commands.
CHANGELOG.md Records dashboard features and compatibility changes.
adr/​appendix-gateway.md Specifies status data and operator access.
.pre-commit-config.yaml Adds the dashboard lint hook.
.gitignore Excludes dashboard output and dependencies.
.github/​workflows/​release.yml Builds dashboard assets and rejects fallback binaries.
.github/​workflows/​ci.yml Adds dashboard validation and packaging checks.
.github/​scripts/​tests/​test_pnpm_wrapper.py Tests pnpm and corepack selection.
.github/​scripts/​tests/​test_dashboard_lint.py Tests conditional dashboard linting.
.github/​scripts/​tests/​test_check_package_embeds.py Tests OUT_DIR and package inclusion checks.
.github/​scripts/​tests/​test_check_dashboard_packaged.py Tests dashboard packaging safeguards.
.github/​scripts/​pnpm.sh Runs pnpm directly or through corepack.
.github/​scripts/​dashboard-lint.sh Runs linting when dependencies are installed.
.github/​scripts/​check-dashboard-packaged.sh Checks package assets and checkout cleanliness.
.github/​scripts/​check_package_embeds.py Validates generated embeds and inclusion patterns.
.github/​actions/​dashboard-build/​action.yml Shares dashboard setup, checks, and builds.

Review effort: Balanced

Comment thread crates/cli/Cargo.toml Resolved
thiras and others added 5 commits October 27, 2026 17:23
…room

The recorded spend is a lower bound, so deposit less spend bounds what the
pool's signers can still spend from above. The docs said the reverse, and
the dashboard showed it as a definite balance; it now reads "up to".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ay pays under

A gateway paying under --capability signs delegate lanes, which /_status
never read. The store read is now read_pools() over any BuyerPoolStore,
tested with the in-memory store.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…way and node

`decdn dashboard` serves the Vite page on 127.0.0.1:8485 behind its own
token. Its process reads every source and the page reads only its
same-origin `/_status`:

- the `decdn get` runs on the host, from the record each run now writes
  to ~/.decdn/activity/pulls/ (rewritten every second, kept 200 deep);
- the gateway at --gateway, from its `/_status`, when one answers;
- the node's health, status, /metrics, lanes, earnings, buyer pools and
  slashes, from its admin RPC, when one runs.

The gateway no longer serves the page: it keeps `/_status` on its host
and on --metrics-listen, and `/` names `decdn dashboard`. The token,
Host and response helpers move to commands/local_http for both servers.
The ADR's dashboard section moves to appendix-binaries § Dashboard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras thiras changed the title feat(gateway): a Vite dashboard and GET /_status, with metrics on every gateway feat(cli): decdn dashboard and the gateway's GET /_status, with metrics on every gateway Oct 27, 2026
thiras and others added 2 commits October 27, 2026 19:04
…ack, sections fail alone

- ActivityRecorder::finish waits for the aborted heartbeat, so a run's end
  is its last write and never reverts to `running`.
- The gateway token goes to a loopback --gateway only, and the dashboard
  follows no redirect; the token file is re-read each poll, and a named
  file that cannot be read is an error naming it.
- A bundle blob's position is keyed by its first path, so a second pass
  after a pool replacement counts it once.
- Only a refused connection reads as no gateway or no node; other failures
  keep their whole cause, and a node whose health read failed still shows
  its other reads.
- PullState carries a run's end and error; bundle counts land with the end;
  Part timestamps exist only once a read is made.
- The page draws each section inside an error boundary, checks the gateway
  body's shape, and marks a section whose last read is three polls old.
- Heartbeat write failures warn once, an unlistable pulls directory, a
  dead poller, a failed prune and a failed accept are each reported.
- Tests for the bundle observer wiring, the heartbeat, every end state,
  per-node merging, prune-on-start, node state and token re-reads; a third
  pinned fixture with failing sources. Docs and ADR wording corrected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A long `-o` path pushed the size, duration, paid and node columns out of
the card, and an error squeezed into the last column stretched its row.
The output shows its last two segments, with the full path on hover, and
an error reads on its own line under the run, across the table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

2 participants