Skip to content

fix(truapi): stop registering product statement allowances for background renewal - #1490

Draft
todortodorovic wants to merge 1 commit into
feat/jam-peer-transport-on-seityfrom
fix/statement-renewal-product-grants
Draft

todortodorovic wants to merge 1 commit into
feat/jam-peer-transport-on-seityfrom
fix/statement-renewal-product-grants

Conversation

@todortodorovic

Copy link
Copy Markdown
Contributor

Problem

On this branch, allocate_statement_store_allowance in
signing_host/sso_responder.rs asks the renewal ledger to keep every product
statement-store allowance it issues. It calls allowance_renewal::track with
StatementRenewalTarget::ProductStatementAllowance.

The ledger refuses every product grant. track_targets in
allowance_renewal/driver.rs returns an error whenever is_product_grant
holds, because product allowance decisions live in artifact-scoped product
storage that background renewal cannot read. Product allowances are provisioned
on demand by an authorized request and are never renewed in the background.

So the call can only fail. It runs after the allowance has been issued, and it
logs:

failed to record statement-store renewal target product_id=truapi-playground.paseo reason=Product statement allowances require an authorized product request; background renewal cannot access artifact-scoped permissions

The allocation still succeeds, so nothing breaks, but the warning reads like a
renewal failure to anyone watching a signing host's log. A truapi-host CLI
signing host built from epoca/truapi-024 (05f5c8c) logs it when a product
requests its statement-store allowance.

feat/chat-v2-product-authority dropped this call in 172afb2. Its changeset,
.changeset/chat-product-authority.md, says: "Remove the obsolete
product-renewal registration attempt now that product grants are provisioned
on demand rather than renewed globally." The merge of that work into this
branch, 9b8b339 ("Merge qualified Chat and Profile authority into the
integration layer"), kept this branch's copy of the function, call included.

feat/chat-seity-profile (#1001) does not have the call. This branch,
feat/media-on-jam-seity (#1217) and epoca/truapi-024 do. main is not
affected, because there the ledger accepts and renews product grants.

Change

allocate_statement_store_allowance issues the allowance without touching the
renewal ledger, as it does on feat/chat-seity-profile. The ledger itself is
unchanged: it still refuses product grants a host passes to
track_statement_renewal_targets, and still prunes product entries an older
build recorded.

Changeset

None added. .changeset/chat-product-authority.md on this branch already
describes this removal, so this pull request needs the no-changeset label for
the Changeset guard.

Tests

issuing_an_allowance_does_not_register_it_for_background_renewal, in
signing_host/tests/allowance_keys.rs, issues an allowance on a chain where
it is already registered, records the WARN events emitted meanwhile, and
expects none. The test reaches allocate_statement_store_allowance through the
signing host's own statement_store_allowance_key; the SSO service calls the
same function when a paired product requests its allowance.

The test keeps a second tracing dispatcher alive while it runs. With only one,
tracing decides whether the warning's callsite is enabled from the first thread
to reach it, and a parallel test with no subscriber can switch it off for this
test, which then passes without seeing the warning. Without the second
dispatcher, most runs of the signing_host::tests module passed even with the
registration call still in place: 17 of 20 in one series and 20 of 20 in
another.

Without the change the test fails with the warning above
(product_id=myapp.dot) on every run: 20 of 20 runs of the
signing_host::tests module, 5 of 5 of allowance_keys and 4 of 4 of the
whole library. With the change all of those runs pass.

  • cargo test -p truapi --all-features (Rust 1.98.1): 1931 passed, 0 failed,
    1 ignored.
  • cargo +nightly-2026-09-01 clippy -p truapi --all-targets --all-features -- -D warnings:
    no warnings.
  • cargo check --target wasm32-unknown-unknown -p truapi (Rust 1.96.0): no
    warnings.
  • CI's Rust workspace job already fails on this branch at cargo build, before
    it reaches formatting, clippy or tests: the wasm_bridge.rs tests in
    truapi-codegen set api_type_paths, a field BridgeCtx does not have
    (E0560). This pull request does not touch that, so its Rust workspace job
    will fail the same way and the new test will not run in CI.
  • make fmt-check also already fails on this branch without this change (2,899
    hunks across the workspace). The added lines are formatted: rustfmt reports
    the same 27 hunks in allowance_keys.rs before and after, none on the new
    lines.

…ound renewal

The renewal ledger refuses every product grant by design (d956dda), but
the merge in 9b8b339 kept the jam branch's tracking call in the SSO
responder, so each product statement allocation logged a failed attempt
to record a renewal target. Drop the call; product grants stay
provisioned on demand.
@todortodorovic todortodorovic added the ci:no-changeset Changes no published artifact, so the changeset check passes without one label Oct 18, 2026
@github-actions github-actions Bot added the area:core Touches the Rust core under rust/crates label Oct 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Bundle size report

Compared with main at a12214e.

Raw Gzip Brotli
truapi-host 8.38 MiB (+482.8 KiB, +6.0%) 5.88 MiB (+220.6 KiB, +3.8%) 5.55 MiB (+163.6 KiB, +3.0%)
truapi-provider 4.03 MiB (-11 B) 1.27 MiB (+7 B) 959.8 KiB (-1.1 KiB, -0.1%)
truapi 6.64 MiB (+342.8 KiB, +5.3%) 955.5 KiB (+63.9 KiB, +7.2%) 780.7 KiB (+50.8 KiB, +7.0%)
Total 19.05 MiB (+825.6 KiB, +4.4%) 8.09 MiB (+284.5 KiB, +3.6%) 7.25 MiB (+213.3 KiB, +3.0%)

WebAssembly modules

Raw Gzip Brotli
truapi-host/wasm/web/truapi_server_bg.wasm 3.11 MiB (+319.3 KiB, +11.1%) 1.16 MiB (+186.1 KiB, +18.6%) 885.8 KiB (+134.0 KiB, +17.8%)
truapi-host/wasm/web/truapi_verifiable_bg.wasm 4.89 MiB 4.64 MiB (+6 B) 4.61 MiB (-58 B)
truapi-provider/truapi_provider_bg.wasm 3.99 MiB (-11 B) 1.26 MiB (+3 B) 952.1 KiB (-1.1 KiB, -0.1%)
Changed files (37)
Raw Gzip Brotli
truapi-host/wasm/web/truapi_server_bg.wasm 3.11 MiB (+319.3 KiB, +11.1%) 1.16 MiB (+186.1 KiB, +18.6%) 885.8 KiB (+134.0 KiB, +17.8%)
truapi/explorer/codegen/types.js 326.7 KiB (+104.6 KiB, +47.1%) 46.9 KiB (+16.1 KiB, +52.2%) 36.6 KiB (+12.0 KiB, +48.7%)
truapi/playground/codegen/truapi-dts.js 389.1 KiB (+97.1 KiB, +33.2%) 68.8 KiB (+18.4 KiB, +36.5%) 54.5 KiB (+13.9 KiB, +34.2%)
truapi-host/browser-receiving-worker.js (new) 33.8 KiB 6.6 KiB 5.8 KiB
truapi/jam-peer-transport.js (new) 29.7 KiB 6.6 KiB 5.7 KiB
truapi/playground/codegen/services.js 126.6 KiB (+25.1 KiB, +24.7%) 20.7 KiB (+5.1 KiB, +33.1%) 17.2 KiB (+4.2 KiB, +32.0%)
truapi/generated/types.js 88.2 KiB (+23.9 KiB, +37.1%) 10.8 KiB (+3.0 KiB, +38.7%) 9.1 KiB (+2.5 KiB, +36.8%)
truapi/generated/client.js 94.9 KiB (+22.3 KiB, +30.6%) 14.9 KiB (+3.9 KiB, +35.4%) 12.3 KiB (+3.1 KiB, +34.0%)
truapi-host/web/native-chat-files.js (new) 20.5 KiB 4.6 KiB 4.0 KiB
truapi-host/wasm/web/truapi_server.js 78.1 KiB (+20.1 KiB, +34.6%) 12.4 KiB (+1.8 KiB, +17.4%) 10.6 KiB (+1.5 KiB, +16.4%)
truapi-host/web/create-worker-host-runtime.js 69.9 KiB (+15.9 KiB, +29.5%) 14.4 KiB (+2.6 KiB, +22.4%) 12.5 KiB (+2.2 KiB, +21.7%)
truapi-host/web/native-chat-media.js (new) 12.0 KiB 3.3 KiB 2.9 KiB
truapi/notification-envelope.js (new) 10.7 KiB 3.2 KiB 2.8 KiB
truapi-host/worker-runtime.js 48.6 KiB (+10.1 KiB, +26.3%) 11.5 KiB (+1.7 KiB, +17.0%) 10.0 KiB (+1.4 KiB, +16.8%)
truapi/jam-peer-transport-cert.js (new) 9.0 KiB 3.4 KiB 3.0 KiB
truapi-host/generated/host-callbacks.js 19.1 KiB (+8.4 KiB, +77.6%) 5.5 KiB (+2.0 KiB, +58.3%) 4.7 KiB (+1.7 KiB, +59.6%)
truapi/notification-container.js (new) 7.9 KiB 2.3 KiB 2.0 KiB
truapi/generated/wire-decode.js 36.9 KiB (+7.8 KiB, +26.9%) 3.8 KiB (+716 B, +22.7%) 3.2 KiB (+623 B, +23.5%)
truapi-host/browser-receiving.js (new) 6.6 KiB 1.9 KiB 1.7 KiB
truapi-host/wallet-allowances.js (new) 6.5 KiB 1.7 KiB 1.5 KiB
truapi-host/browser-receiving-transport.js (new) 6.1 KiB 2.2 KiB 1.9 KiB
truapi-host/adapter-support.js 9.4 KiB (+6.0 KiB, +174.7%) 2.8 KiB (+1.4 KiB, +108.4%) 2.4 KiB (+1.2 KiB, +101.6%)
truapi-host/worker-local-identity.js (new) 5.7 KiB 1.8 KiB 1.5 KiB
truapi-host/generated/host-callbacks-adapter.js 11.6 KiB (+4.5 KiB, +64.1%) 2.5 KiB (+911 B, +56.4%) 2.1 KiB (+791 B, +56.1%)
truapi-host/generated/worker-callbacks.js 10.7 KiB (+3.4 KiB, +46.7%) 2.1 KiB (+602 B, +39.5%) 1.7 KiB (+487 B, +38.9%)
truapi/generated/wire-table.js 11.4 KiB (+2.4 KiB, +26.0%) 1.9 KiB (+279 B, +17.0%) 1.5 KiB (+220 B, +17.1%)
truapi-host/locale.js (new) 1.9 KiB 689 B 622 B
truapi-host/runtime.js 2.3 KiB (+1.6 KiB, +215.6%) 855 B (+419 B, +96.1%) 692 B (+361 B, +109.1%)
truapi/client.js 34.4 KiB (+1.3 KiB, +3.8%) 8.3 KiB (+305 B, +3.7%) 7.1 KiB (+262 B, +3.7%)
truapi/development.js (new) 942 B 508 B 446 B
truapi-host/worker-protocol.js 3.7 KiB (+282 B, +8.1%) 1.4 KiB (+157 B, +12.2%) 1.1 KiB (+114 B, +10.7%)
truapi/sandbox.js 13.5 KiB (+153 B, +1.1%) 4.2 KiB (+68 B, +1.6%) 3.6 KiB (+54 B, +1.5%)
truapi-host/worker-dispatch.js 1.5 KiB (+116 B, +8.2%) 456 B (+56 B, +14.0%) 400 B (+54 B, +15.6%)
truapi-host/web/index.js 256 B (+111 B, +76.6%) 156 B (+42 B, +36.8%) 136 B (+18 B, +15.3%)
truapi-host/index.js 80 B (+50 B, +166.7%) 80 B (+30 B, +60.0%) 67 B (+33 B, +97.1%)
truapi/index.js 591 B (+34 B, +6.1%) 293 B (+8 B, +2.8%) 224 B (+4 B, +1.8%)
truapi-provider/truapi_provider_bg.wasm 3.99 MiB (-11 B) 1.26 MiB (+3 B) 952.1 KiB (-1.1 KiB, -0.1%)

Commit: 6f06115

@github-actions

Copy link
Copy Markdown
Contributor

CI Status: not green, 3 items need attention.

  • rust: failure
  • host-android-bindings: failure
  • ts-host: failure
All job results
job result
android-bindings success
bundle-size success
changes success
changeset-guard success
cli-package success
codegen success
e2e skipped
explorer success
headless-install success
host-android-bindings failure
host-android-detekt success
host-wasm success
ios-bindings success
ios-swift success
licenses success
playground success
provider-android-bindings skipped
release-guard success
rust failure
ts-client success
ts-debugger success
ts-host failure
wasm-provider success
workflow-lint skipped

Signing credentials: failure as of 2026-10-16, a release may fail

Commit 6f06115b · run log

@BigTava BigTava added the Stability Crashes, reloads, hangs and dropped connections label Oct 21, 2026
@TarikGul TarikGul added the size:M Pull requests only. 200 to 499 lines changed label Oct 30, 2026
@TarikGul TarikGul added size:S Pull requests only. 50 to 199 lines changed and removed size:M Pull requests only. 200 to 499 lines changed labels Nov 18, 2026

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

area:core Touches the Rust core under rust/crates ci:no-changeset Changes no published artifact, so the changeset check passes without one size:S Pull requests only. 50 to 199 lines changed Stability Crashes, reloads, hangs and dropped connections

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants