core: publish self-hosted weekly dashboard and Proxmox deployment #20

Merged
schmidt.florian merged 7 commits from 19-web-dashboard into master 2026-11-15 11:24:57 +01:00
Owner

Closes #19

What and why

FinalToken now answers whether measured allowance will last until the actual weekly reset from a self-hosted dashboard, using the existing Core pace forecasts, daily budgets and reset history. The server combines accounts and machine/profile health without multiplying shared quota; workers persist metadata and reconcile shared consumption while keeping stale/unknown values explicit.

Official Claude manual-code and Codex device-code login attempts are routed to the selected machine/user/profile and initiating browser session. Provider credentials remain owned by the real CLI. Authorization responses are transient; cancellation, timeouts, worker restarts and account mismatches have explicit outcomes.

Add a Proxmox host installer for unprivileged Debian 13 server/worker LXCs and a one-command updater that fetches a clean tracking checkout, fast-forwards without overwriting ignored local state, and enters the fetched installer. Updates preserve role/configuration/history and roll back failed binary activation. Add MIT licensing, publication checks and operator documentation. Version: 1.2.0.

Decisions

D1, D2, D3, D4, D5, D6, D7, D12 and D13 remain the basis of the implementation. D2 is clarified and D14 records the developer-authorized self-hosted hosts and transient official CLI authorization-response relay. No inference gateway, provider-token pool, private provider API or automatic account switching is added. No new NuGet package is introduced; the server uses the .NET shared framework.

How it was tested

Author verification for this implementation:

  • dotnet build FinalToken.slnx -c Release: 0 warnings/errors.
  • dotnet test --solution FinalToken.slnx -c Release: 431 passed, 0 failed/skipped.
  • python -B tools/test_web_dashboard.py: 1 HTTP/worker/process integration test passed, using synthetic CLI processes and metadata.
  • python -B tools/proxmox/test_installer.py: 26 passed, including an offline real-npm launcher regression.
  • python -B tools/proxmox/test_update.py: 11 passed, using real local Git/Bash and a synthetic installer.
  • python -B tools/test_check_public.py: 10 passed.
  • python -B tools/docs/test_check_docs.py: 15 passed.
  • python -B tools/test_publish.py: 2 passed, including explicit LF/CRLF license fixtures.
  • python -B tools/docs/check_docs.py, Bash syntax checks for both host entry scripts and git diff --check: passed.
  • Checksum-verified Gitleaks source/index/history scans: 0 findings; targeted publication audit also clean. NuGet audit reported no vulnerable entries.
  • Synthetic dashboard visual QA produced sign-in, weekly outlook, machines, Claude login and mobile screenshots. No real provider credentials were used.

Real Proxmox create/update, Linux NativeAOT publishing, Linux advisory locking, certificate issuance and live official provider authorization have not been exercised. Installer/systemd/package and advisory-lock command results are substituted in tests. Claude manual stdin handoff remains subject to actual installed CLI behavior; Codex uses official device auth. Runtime machine/account enrollment is operator configuration, as documented.

Closes #19 ## What and why FinalToken now answers whether measured allowance will last until the actual weekly reset from a self-hosted dashboard, using the existing Core pace forecasts, daily budgets and reset history. The server combines accounts and machine/profile health without multiplying shared quota; workers persist metadata and reconcile shared consumption while keeping stale/unknown values explicit. Official Claude manual-code and Codex device-code login attempts are routed to the selected machine/user/profile and initiating browser session. Provider credentials remain owned by the real CLI. Authorization responses are transient; cancellation, timeouts, worker restarts and account mismatches have explicit outcomes. Add a Proxmox host installer for unprivileged Debian 13 server/worker LXCs and a one-command updater that fetches a clean tracking checkout, fast-forwards without overwriting ignored local state, and enters the fetched installer. Updates preserve role/configuration/history and roll back failed binary activation. Add MIT licensing, publication checks and operator documentation. Version: 1.2.0. ## Decisions D1, D2, D3, D4, D5, D6, D7, D12 and D13 remain the basis of the implementation. D2 is clarified and D14 records the developer-authorized self-hosted hosts and transient official CLI authorization-response relay. No inference gateway, provider-token pool, private provider API or automatic account switching is added. No new NuGet package is introduced; the server uses the .NET shared framework. ## How it was tested Author verification for this implementation: - `dotnet build FinalToken.slnx -c Release`: 0 warnings/errors. - `dotnet test --solution FinalToken.slnx -c Release`: 431 passed, 0 failed/skipped. - `python -B tools/test_web_dashboard.py`: 1 HTTP/worker/process integration test passed, using synthetic CLI processes and metadata. - `python -B tools/proxmox/test_installer.py`: 26 passed, including an offline real-npm launcher regression. - `python -B tools/proxmox/test_update.py`: 11 passed, using real local Git/Bash and a synthetic installer. - `python -B tools/test_check_public.py`: 10 passed. - `python -B tools/docs/test_check_docs.py`: 15 passed. - `python -B tools/test_publish.py`: 2 passed, including explicit LF/CRLF license fixtures. - `python -B tools/docs/check_docs.py`, Bash syntax checks for both host entry scripts and `git diff --check`: passed. - Checksum-verified Gitleaks source/index/history scans: 0 findings; targeted publication audit also clean. NuGet audit reported no vulnerable entries. - Synthetic dashboard visual QA produced sign-in, weekly outlook, machines, Claude login and mobile screenshots. No real provider credentials were used. Real Proxmox create/update, Linux NativeAOT publishing, Linux advisory locking, certificate issuance and live official provider authorization have not been exercised. Installer/systemd/package and advisory-lock command results are substituted in tests. Claude manual stdin handoff remains subject to actual installed CLI behavior; Codex uses official device auth. Runtime machine/account enrollment is operator configuration, as documented.
schmidt.florian added the type/featuretype/decisiontype/tooling labels 2026-11-15 11:00:52 +01:00
schmidt.florian added 3 commits 2026-11-15 11:00:52 +01:00
Ship MIT notices with published outputs and keep runtime credentials, configuration and history out of source archives. Audit working files, staged blobs and reachable history before publication.

Refs #19
Reuse the existing weekly pace, reset history and daily budgets across multiple machines without multiplying shared account quota. Coordinate profile-bound official CLI logins through transient authorization responses while keeping provider credentials local to each CLI. Release as version 1.2.0.

Refs #19
Create unprivileged server or worker LXCs and build native binaries inside the container. Refresh a clean published checkout before updates, preserve configuration and history, and roll back failed binary activation without resetting local source work.

Refs #19
Author
Owner

Agent review: fail on b23b7289c7

Blocking

  1. [P1] tools/proxmox/guest.py:124: Install Codex into the executable directory used by the worker. npm install --prefix ~/.local @openai/codex@latest is a local install: its launcher goes in ~/.local/node_modules/.bin, not ~/.local/bin. The following version check and generated worker profile both require ~/.local/bin/codex, so a fresh default (both) or Codex worker installation stops before building/activating the service. A provider-free local npm package reproduced exit 0 with node_modules/.bin/codex present and bin/codex absent. Use a global install with the user-owned prefix (or consistently configure the actual local launcher), and add a regression that checks the installed launcher rather than mocking every install command.

  2. [P2] src/FinalToken.Fleet/FleetAnalysis.cs:59-61: Apply account attribution checks to legacy imports too. Raw usage and quota correctly use verified, but the designated legacy source is selected from all profiles. With a migration cutoff and a retained source whose DataEmail differs from the configured account email (for example after an operator changes the account binding), its legacy buckets still enter this account's token/API-value totals and reset analysis. The dashboard even warns that mismatched profiles were excluded while including those buckets. A synthetic regression using the existing Fleet test helpers expected 0 tokens and got 100 from the mismatched legacy source. Select the legacy source from verified and report an unavailable/unverified source when absent; cover mismatched and unattributed legacy data.

  3. [P2] tools/test_publish.py:36: Make the ZIP license assertion independent of checkout line endings. read_text() normalizes CRLF to LF, whereas bundle.read(...).decode() preserves the archived bytes. On this Windows checkout (core.autocrlf=true), python -B tools/test_publish.py fails its new assertion even though the license is copied correctly. Compare bytes on both sides, normalize both text values, or enforce an intentional LICENSE line-ending policy. The supported Windows check must pass.

Notes

  • Live Proxmox creation/update, Linux NativeAOT publishing, TLS issuance, Linux advisory locking and actual provider authorization remain unverified, as the PR states. The synthetic CLI test proves routing/process handling, not compatibility with an installed provider's live/manual login flow. I did not repeat browser visual QA; the PR reports author screenshots outside tracked source.

Checked

Reviewed b23b7289c7968e2078e51277da56aecdff9783b0 against origin/master (c02829e2e19ff610e9b540aec15cfbd52998d99e) in a separate detached worktree. Read the PR, linked issue #19, root/touched-project rules, requirements, relevant decisions (including D14), project mind and full change contents. PR comments and reviews were empty; this is the initial review.

Commands/results from the review worktree:

  • dotnet build FinalToken.slnx -c Release: passed, 0 warnings/errors.
  • dotnet test --solution FinalToken.slnx -c Release: 427 passed, 0 failed/skipped.
  • python -B tools/test_web_dashboard.py: 1 passed; real local HTTP/worker/child-process integration with synthetic providers.
  • python -B tools/proxmox/test_installer.py: 25 passed (external commands mocked).
  • python -B tools/proxmox/test_update.py: 11 passed (real local Git/Bash; advisory locking substituted).
  • python -B tools/test_check_public.py: 10 passed.
  • python -B tools/docs/test_check_docs.py: 15 passed.
  • python -B tools/test_publish.py: 1 failed, as detailed above.
  • python -B tools/docs/check_docs.py: 0 errors.
  • node --check src/FinalToken.Web/wwwroot/app.js, Bash syntax checks of both Proxmox entry scripts, and git diff --check origin/master...HEAD: passed.
  • Additional temporary Fleet regression for mismatched legacy attribution: 1 failed (expected 0, actual 100). Removed the temporary test from project sources after running it; retained a copy under ignored review artifacts.
  • Provider-free offline local npm-package installation reproduced the launcher-directory mismatch. No real provider, Proxmox host or deployment was accessed.

No production code changed; tracked worktree is clean.

**Agent review: fail** on b23b7289c7968e2078e51277da56aecdff9783b0 ## Blocking 1. **[P1] `tools/proxmox/guest.py:124`: Install Codex into the executable directory used by the worker.** `npm install --prefix ~/.local @openai/codex@latest` is a local install: its launcher goes in `~/.local/node_modules/.bin`, not `~/.local/bin`. The following version check and generated worker profile both require `~/.local/bin/codex`, so a fresh default (`both`) or Codex worker installation stops before building/activating the service. A provider-free local npm package reproduced exit 0 with `node_modules/.bin/codex` present and `bin/codex` absent. Use a global install with the user-owned prefix (or consistently configure the actual local launcher), and add a regression that checks the installed launcher rather than mocking every install command. 2. **[P2] `src/FinalToken.Fleet/FleetAnalysis.cs:59-61`: Apply account attribution checks to legacy imports too.** Raw usage and quota correctly use `verified`, but the designated legacy source is selected from all `profiles`. With a migration cutoff and a retained source whose `DataEmail` differs from the configured account email (for example after an operator changes the account binding), its legacy buckets still enter this account's token/API-value totals and reset analysis. The dashboard even warns that mismatched profiles were excluded while including those buckets. A synthetic regression using the existing Fleet test helpers expected 0 tokens and got 100 from the mismatched legacy source. Select the legacy source from `verified` and report an unavailable/unverified source when absent; cover mismatched and unattributed legacy data. 3. **[P2] `tools/test_publish.py:36`: Make the ZIP license assertion independent of checkout line endings.** `read_text()` normalizes CRLF to LF, whereas `bundle.read(...).decode()` preserves the archived bytes. On this Windows checkout (`core.autocrlf=true`), `python -B tools/test_publish.py` fails its new assertion even though the license is copied correctly. Compare bytes on both sides, normalize both text values, or enforce an intentional LICENSE line-ending policy. The supported Windows check must pass. ## Notes - Live Proxmox creation/update, Linux NativeAOT publishing, TLS issuance, Linux advisory locking and actual provider authorization remain unverified, as the PR states. The synthetic CLI test proves routing/process handling, not compatibility with an installed provider's live/manual login flow. I did not repeat browser visual QA; the PR reports author screenshots outside tracked source. ## Checked Reviewed `b23b7289c7968e2078e51277da56aecdff9783b0` against `origin/master` (`c02829e2e19ff610e9b540aec15cfbd52998d99e`) in a separate detached worktree. Read the PR, linked issue #19, root/touched-project rules, requirements, relevant decisions (including D14), project mind and full change contents. PR comments and reviews were empty; this is the initial review. Commands/results from the review worktree: - `dotnet build FinalToken.slnx -c Release`: passed, 0 warnings/errors. - `dotnet test --solution FinalToken.slnx -c Release`: 427 passed, 0 failed/skipped. - `python -B tools/test_web_dashboard.py`: 1 passed; real local HTTP/worker/child-process integration with synthetic providers. - `python -B tools/proxmox/test_installer.py`: 25 passed (external commands mocked). - `python -B tools/proxmox/test_update.py`: 11 passed (real local Git/Bash; advisory locking substituted). - `python -B tools/test_check_public.py`: 10 passed. - `python -B tools/docs/test_check_docs.py`: 15 passed. - `python -B tools/test_publish.py`: 1 failed, as detailed above. - `python -B tools/docs/check_docs.py`: 0 errors. - `node --check src/FinalToken.Web/wwwroot/app.js`, Bash syntax checks of both Proxmox entry scripts, and `git diff --check origin/master...HEAD`: passed. - Additional temporary Fleet regression for mismatched legacy attribution: 1 failed (expected 0, actual 100). Removed the temporary test from project sources after running it; retained a copy under ignored review artifacts. - Provider-free offline local npm-package installation reproduced the launcher-directory mismatch. No real provider, Proxmox host or deployment was accessed. No production code changed; tracked worktree is clean.
Author
Owner

All three blockers from the first review are reproduced by failing regressions before fixes: three legacy provider/email-attribution cases incorrectly imported 100 tokens; the explicit CRLF license fixture failed; and an actual offline npm-package install did not create the configured launcher. Fixes are in progress: select only account-attributed legacy sources; use a service-user-owned global npm prefix; compare packaged license bytes. Re-running the affected checks, then pushing focused fixes for a new fresh review.

All three blockers from the first review are reproduced by failing regressions before fixes: three legacy provider/email-attribution cases incorrectly imported 100 tokens; the explicit CRLF license fixture failed; and an actual offline npm-package install did not create the configured launcher. Fixes are in progress: select only account-attributed legacy sources; use a service-user-owned global npm prefix; compare packaged license bytes. Re-running the affected checks, then pushing focused fixes for a new fresh review.
schmidt.florian added 1 commit 2026-11-15 11:14:56 +01:00
Apply provider and historical account identity checks to the designated hourly import source. Retain previously attributed history when a CLI signs out, while excluding mismatched or unknown accounts.

Refs #19
schmidt.florian added 1 commit 2026-11-15 11:15:09 +01:00
Use a global npm install within the service user's prefix so the configured .local/bin launcher exists. Exercise npm with an offline synthetic package and check the installed launcher without contacting a provider.

Refs #19
schmidt.florian added 1 commit 2026-11-15 11:15:26 +01:00
Validate source, copied and archived notices byte-for-byte for both LF and CRLF checkouts. Keep platform newline conversion from causing false release-test failures.

Refs #19
schmidt.florian added 1 commit 2026-11-15 11:16:45 +01:00
Keep the remaining Linux deployment and provider authorization checks visible after shipping the implemented dashboard and Proxmox tooling.

Refs #19
Author
Owner

The three blocking findings are fixed in 583f920, e148824 and b0c203c; 09c1875 updates the remaining live-validation note.

  1. Codex now installs globally into the service user's .local prefix. A failing regression first used real npm with an offline synthetic package and observed no configured launcher; the fixed test now checks the launcher and package execution, including repeat invocation. No provider/package-registry call occurs; the Windows prefix boundary is explicit.
  2. Designated legacy buckets are selected from the same provider/DataEmail-attributed profiles as raw usage. Three failing cases (mismatched email, null attribution and wrong provider) previously imported 100 tokens and now import none. A separate regression confirms signed-out but historically verified data remains available. Missing/unverified legacy sources are reported.
  3. License assertions compare bytes in source, copied files and ZIPs. The new explicit CRLF fixture failed before the fix and now passes alongside LF; the shared version/manifest test is retained.

Checks: Release build 0 warnings/errors; full solution 431 passed, 0 failed/skipped; installer 26 passed (no skips here); packaging 2 passed; docs and whitespace checks pass. Initial full integration/tooling and publication scans are recorded above. Requesting a fresh re-review of head 09c1875 under the documented re-review scope.

The three blocking findings are fixed in 583f920, e148824 and b0c203c; 09c1875 updates the remaining live-validation note. 1. Codex now installs globally into the service user's `.local` prefix. A failing regression first used real npm with an offline synthetic package and observed no configured launcher; the fixed test now checks the launcher and package execution, including repeat invocation. No provider/package-registry call occurs; the Windows prefix boundary is explicit. 2. Designated legacy buckets are selected from the same provider/DataEmail-attributed profiles as raw usage. Three failing cases (mismatched email, null attribution and wrong provider) previously imported 100 tokens and now import none. A separate regression confirms signed-out but historically verified data remains available. Missing/unverified legacy sources are reported. 3. License assertions compare bytes in source, copied files and ZIPs. The new explicit CRLF fixture failed before the fix and now passes alongside LF; the shared version/manifest test is retained. Checks: Release build 0 warnings/errors; full solution 431 passed, 0 failed/skipped; installer 26 passed (no skips here); packaging 2 passed; docs and whitespace checks pass. Initial full integration/tooling and publication scans are recorded above. Requesting a fresh re-review of head 09c1875 under the documented re-review scope.
Author
Owner

Agent review: pass on 09c1875a7a

## Blocking

None. All three blockers from the failed review on b23b7289c7 are fixed:

  1. tools/proxmox/guest.py:124 now uses a global npm install within the service user's prefix. The offline real-npm regression verifies the configured launcher exists, executes the installed synthetic package, and covers a repeat invocation.
  2. src/FinalToken.Fleet/FleetAnalysis.cs:59 selects the designated legacy source from provider/email-attributed profiles. Regressions exclude mismatched email, missing attribution and wrong provider, and preserve historically verified data when signed out.
  3. tools/test_publish.py:47 compares source, copied and archived license bytes consistently. Explicit LF and CRLF fixtures pass on this Windows checkout.

No blocking findings in the four author commits since the failed review.

Notes

  • Live Proxmox creation/update, Linux NativeAOT publishing, Linux advisory locking, TLS issuance and actual provider authorization remain unverified. The npm regression ran on Windows with the documented prefix adaptation. The HTTP integration uses synthetic providers; it does not establish compatibility with live Claude manual stdin handoff. No browser screenshots were repeated; the re-review changes no views.

Checked

Reviewed head 09c1875a7a1a7a5dc94e92209f941a3adc9ab8e5 in a separate detached worktree against origin/master (c02829e2e19ff610e9b540aec15cfbd52998d99e). Read the PR, linked issue #19, earlier review/comments, root and touched-project rules, requirements, relevant decisions including D14, project mind and full change context. Applied the re-review scope in docs/agents/review.md: checked the prior blockers and reviewed git log -p --no-merges ^b23b7289c7968e2078e51277da56aecdff9783b0 ^origin/master HEAD (583f920, e148824, b0c203c and 09c1875).

Commands/results at the reviewed head:

  • dotnet build FinalToken.slnx -c Release: passed; 0 warnings/errors.
  • dotnet test --solution FinalToken.slnx -c Release: 431 passed; 0 failed/skipped.
  • python -B tools/proxmox/test_installer.py: 26 passed; no skips, including offline real npm.
  • python -B tools/test_publish.py: 2 passed, including LF/CRLF fixtures.
  • python -B tools/test_web_dashboard.py: 1 passed; synthetic HTTP/worker/child-process integration.
  • python -B tools/proxmox/test_update.py: 11 passed; local Git/Bash with advisory-lock substitution.
  • python -B tools/test_check_public.py: 10 passed.
  • python -B tools/docs/test_check_docs.py: 15 passed.
  • python -B tools/docs/check_docs.py: 0 errors.
  • node --check src/FinalToken.Web/wwwroot/app.js: passed.
  • bash -n tools/proxmox.sh and bash -n tools/proxmox-update.sh (Git Bash): passed.
  • git diff --check origin/master...HEAD: passed.

No production code changed; tracked worktree is clean. No live deployment/provider actions were performed.

**Agent review: pass** on 09c1875a7a1a7a5dc94e92209f941a3adc9ab8e5 ## Blocking None. All three blockers from the failed review on b23b7289c7968e2078e51277da56aecdff9783b0 are fixed: 1. `tools/proxmox/guest.py:124` now uses a global npm install within the service user's prefix. The offline real-npm regression verifies the configured launcher exists, executes the installed synthetic package, and covers a repeat invocation. 2. `src/FinalToken.Fleet/FleetAnalysis.cs:59` selects the designated legacy source from provider/email-attributed profiles. Regressions exclude mismatched email, missing attribution and wrong provider, and preserve historically verified data when signed out. 3. `tools/test_publish.py:47` compares source, copied and archived license bytes consistently. Explicit LF and CRLF fixtures pass on this Windows checkout. No blocking findings in the four author commits since the failed review. ## Notes - Live Proxmox creation/update, Linux NativeAOT publishing, Linux advisory locking, TLS issuance and actual provider authorization remain unverified. The npm regression ran on Windows with the documented prefix adaptation. The HTTP integration uses synthetic providers; it does not establish compatibility with live Claude manual stdin handoff. No browser screenshots were repeated; the re-review changes no views. ## Checked Reviewed head `09c1875a7a1a7a5dc94e92209f941a3adc9ab8e5` in a separate detached worktree against `origin/master` (`c02829e2e19ff610e9b540aec15cfbd52998d99e`). Read the PR, linked issue #19, earlier review/comments, root and touched-project rules, requirements, relevant decisions including D14, project mind and full change context. Applied the re-review scope in `docs/agents/review.md`: checked the prior blockers and reviewed `git log -p --no-merges ^b23b7289c7968e2078e51277da56aecdff9783b0 ^origin/master HEAD` (583f920, e148824, b0c203c and 09c1875). Commands/results at the reviewed head: - `dotnet build FinalToken.slnx -c Release`: passed; 0 warnings/errors. - `dotnet test --solution FinalToken.slnx -c Release`: 431 passed; 0 failed/skipped. - `python -B tools/proxmox/test_installer.py`: 26 passed; no skips, including offline real npm. - `python -B tools/test_publish.py`: 2 passed, including LF/CRLF fixtures. - `python -B tools/test_web_dashboard.py`: 1 passed; synthetic HTTP/worker/child-process integration. - `python -B tools/proxmox/test_update.py`: 11 passed; local Git/Bash with advisory-lock substitution. - `python -B tools/test_check_public.py`: 10 passed. - `python -B tools/docs/test_check_docs.py`: 15 passed. - `python -B tools/docs/check_docs.py`: 0 errors. - `node --check src/FinalToken.Web/wwwroot/app.js`: passed. - `bash -n tools/proxmox.sh` and `bash -n tools/proxmox-update.sh` (Git Bash): passed. - `git diff --check origin/master...HEAD`: passed. No production code changed; tracked worktree is clean. No live deployment/provider actions were performed.
schmidt.florian merged commit c75446008c into master 2026-11-15 11:24:57 +01:00
schmidt.florian deleted branch 19-web-dashboard 2026-11-15 11:24:59 +01:00
Sign in to join this conversation.