Feat/staging test - #43
Conversation
- add Rust probe for public Paykit v0 namespace data - expose static JS/WASM discovery methods with custom relay support - distinguish invalid user input from operational lookup failures - derive Paykit namespace from pinned paykit-lib at build time - keep Paykit crypto dependencies outside the WASM runtime graph - pin compatible pubky-noise rc7 build dependency - raise workspace MSRV and build toolchain to Rust 1.91.1 - document data-presence semantics and explicit non-claims - cover Rust, generated API, WASM, and failure behavior Signed-off-by: dzdidi <dzdidi@users.noreply.github.com>
Signed-off-by: dzdidi <dzdidi@users.noreply.github.com>
Signed-off-by: dzdidi <dzdidi@users.noreply.github.com>
Signed-off-by: dzdidi <dzdidi@users.noreply.github.com>
ben-kaufman
left a comment
There was a problem hiding this comment.
I found five issues that should be addressed before merging.
| fn classify_listing(listing: pubky::Result<Vec<PubkyResource>>) -> pubky::Result<bool> { | ||
| match listing { | ||
| Ok(entries) => Ok(!entries.is_empty()), | ||
| Err(pubky::Error::Request(RequestError::Server { status, .. })) |
There was a problem hiding this comment.
This only treats 404 Not Found as an absent Paykit namespace. Pubky and the pinned Paykit library also treat 410 Gone as absence, so deleted or tombstoned data currently produces PaykitDataLookupFailed instead of false. Could we classify StatusCode::GONE as absence too?
| if (!raw) return; | ||
| try { | ||
| Object.assign(state, JSON.parse(raw), { | ||
| Object.assign(state, restorePersistedReaderState(JSON.parse(raw)), { |
There was a problem hiding this comment.
This filters old bearer fields out of memory but leaves the original JSON in localStorage. In staging mode there is no periodic refresh to rewrite it, so credentials saved by the previous implementation can remain on disk indefinitely. Could we rewrite the filtered public state or remove this key after a successful restore?
There was a problem hiding this comment.
I am not sure if the ./examples should stay beyond first release... I kinda intended them for demo for FE team on how do integration.
| render(); | ||
| }); | ||
|
|
||
| el.readerPublicKey.addEventListener('input', () => { |
There was a problem hiding this comment.
The staging reader remains editable while submitPaykitPaymentProof() is running. If the user changes reader A to B after the initial check, the post-submit guard does not compare the reader key, so A’s bundle is accepted while the UI displays B. Could we disable this input during submission or invalidate and recheck the reader snapshot afterward?
| - | | ||
| node examples/js-sdk/scripts/init-staging-config.mjs | ||
| mkdir -p /workspace/.local/paykit-staging-demo/creator-session | ||
| chown -R 1000:1000 /workspace/.local/paykit-staging-demo |
There was a problem hiding this comment.
This hardcodes ownership of the host bind mount to UID/GID 1000. On Linux hosts using another UID, creator-session becomes a 0700 directory that the host user cannot traverse or remove with the documented reset. Could we avoid fixed bind-mount ownership or pass through the host UID/GID?
| "prepare-paykit-reader": "node scripts/prepare-paykit-reader.mjs", | ||
| "receive-paykit-request": "node scripts/receive-paykit-request.mjs", | ||
| "test:paykit-reader-worker": "node scripts/test-paykit-reader-worker.mjs", | ||
| "test:staging-config": "node scripts/test-staging-config.mjs", |
There was a problem hiding this comment.
Could we run the new staging test scripts in CI? They currently exist as standalone package scripts, but the workflow only runs the older setup contract and bindings suite, so the new Compose, staging-mode, persistence, and reset behavior is not gated.
Signed-off-by: dzdidi <dzdidi@users.noreply.github.com>
Signed-off-by: dzdidi <dzdidi@users.noreply.github.com>
ben-kaufman
left a comment
There was a problem hiding this comment.
The 410 handling is fixed. Given these are integration demos that may be removed after the first release, I am treating the remaining demo issues as non-blocking.
If the demos stay in use, please clean up old credentials left in browser storage and prevent a result for reader A from being accepted after switching to reader B. Credential cleanup is worth addressing before using real credentials. The Linux reset permissions and remaining CI suites can be follow-ups.
Signed-off-by: dzdidi <dzdidi@users.noreply.github.com>
Summary
Treat Pubky 410 Gone responses as an absent Paykit namespace, matching existing 404 Not Found behavior.
This makes has_paykit_data return false for deleted or tombstoned Paykit data instead of returning a lookup error. Other failures remain errors.
Contract and risk impact
☑ Public API or SDK contract
☐ Persisted data or migration
☐ Authentication, authorization, identity, or secret handling
☑ Payment or entitlement behavior
☐ Runtime, deployment, or observability
☐ No contract/risk impact
No persisted-data impact. Low risk: change only expands absence classification from 404 to 404 | 410.
Verification
Passed:
• cargo test -p locks-sdk --lib paykit::tests::gone_namespace_means_no_paykit_data -- --exact
• cargo test -p locks-sdk
• cargo test -p locks-sdk-wasm
• cargo clippy -p locks-sdk --all-targets --all-features -- -D warnings
• cargo clippy -p locks-sdk-wasm --target wasm32-unknown-unknown -- -D warnings
• cargo fmt --all -- --check
• git diff --check
Independent closure review: approved with no findings.
Documentation
No documentation changes required. Public API shape is unchanged; behavior now matches Pubky and Paykit absence semantics.
Checklist
☑ The change is focused and self-reviewed.
☑ Regression tests were added where practical.
☑ No credentials, identities, private content, payment material, or generated local state are included.
☑ Formatting and relevant tests/lints pass.