Skip to content

refactor: remove hosted public URL usage accounting - #476

Open
0xcadams wants to merge 8 commits into
0xcadams/time-based-guest-demosfrom
0xcadams/remove-hosted-usage
Open

0xcadams wants to merge 8 commits into
0xcadams/time-based-guest-demosfrom
0xcadams/remove-hosted-usage

Conversation

@0xcadams

Copy link
Copy Markdown
Member

What

Remove the native hosted usage-accounting system as the next layer of the coordinated public-ingress/native-peer rewrite. Traffic forwarding keeps operator measurements, admission, IP policy, and guest time authority; control no longer stores or delivers customer transfer reports.

This follows #474 and belongs below the final integration gate in #470. The matching website layer removes the receiver, tables, transfer page, and transfer-review job.

Why

Hosted usage accounting is being retired without a replacement ledger or transfer UI. Guest demos now have durable ready-time authority, so their enforcement no longer depends on byte reports. Keeping the old collectors and delivery workers would retain unnecessary state and make the connection-path rewrite depend on an obsolete system.

Changes

  • Remove ingress collection, control aggregation/finalization/outbox workers, visitor-network sketches and keys, receiver settings, the usage integration contract, and website team-usage authorization.
  • Remove usage-fed publish-run denial totals and their CLI notifications; keep actual IP-policy enforcement and operator byte/capacity/recovery measurements.
  • Preserve the expired-ingress-run fence in the ingress lease query and retain independent lock-order, forwarding, source, capacity, recovery, and shutdown assertions at their owners.
  • Retire usage-only workload traffic while retaining the database load selectors, tiers, routing checks, and real-clock cadence/recovery proof.
  • Update shared generated sources and copy in place on v1, including the undecided future-plans wording. Release and package versions remain unchanged.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T08:35:14.945329Z fa3e200 New commits
🔒 Security Review ✅ Completed 2026-10-27T08:38:10.755020Z fa3e200 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@0xcadams

Copy link
Copy Markdown
Member Author

Matching website PR: https://github.com/tnldotdev/tnl.dev/pull/191.

Passed locally on 294167a: generation/format checks, routine Go tests, Go lint, ingress races, PostgreSQL guest/storage/instrumentation and independent lock-order/run-fence checks, and database load smoke for steady state, relay recovery, and shutdown (PUBLIC_URLS=4). The real-clock cadence target also passed with PUBLIC_URLS=4 DURATION=2m: 32/32 heartbeats, zero late work, both affected slots recovered, current routing on both ingress processes.

The guest runtime still serves its page/fonts/ping and closes an open visitor TLS connection within the ready deadline during a control outage after usage removal. Forwarding/source/capacity/cleanup assertions from the former server_usage suite live in server_forwarding_test.go; usage-only assertions are retired.

The older Linux cross-team publisher-groups cleanup deadline failure remains tracked at the final integration gate.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 294167acca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +95 to +96
OR (control.ingress_leases.ingress_run_id <> EXCLUDED.ingress_run_id
AND control.ingress_leases.lease_expires_at <= EXCLUDED.registered_at)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the fence for previously retired ingress runs

If run A expires, run B replaces it, and B subsequently expires, this predicate accepts another registration from A because it compares only against B. Previously, ensureIngressUsageRun rejected that registration because A's stored lease revision differed, rolling back the replacement. This can occur when A keeps retrying its initial registration after losing the successful response: its controller has no acknowledged lease for the local expiry watchdog to fence. Removing the history check therefore allows a retired process run to obtain a fresh lease and serve again. Preserve retired-run fencing independently of usage accounting, and extend the registration test to cover A → B → A.

AGENTS.md reference: AGENTS.md:L213-L214

Useful? React with 👍 / 👎.

@0xcadams
0xcadams removed this pull request from stack #477 October 27, 2026 03:04
@0xcadams
0xcadams added this pull request to stack #480 October 27, 2026 03:05

This branch has not been deployed

No deployments
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.

1 participant