Repository navigation
feat(flutter): hire detail screen (S06, /hires/:id) that polls getHire until final and shows the agent's result, plus PULS3_HIRE for the Pages build - #150
Merged
moises-cisneros merged 1 commit intoOct 10, 2026
Conversation
…the agent's result - HireGateway.getHire returns HireProgress (from HireDetail): escrow status, run status, failure reason, result and the fund tx. HireStage derives Funded/Queued/Running/Result ready/Run failed/Submitted/ Completed/Rejected (Cancelled from open)/Expired; a succeeded run that is still `running` with a result reads as Result ready. - ServerHireGateway maps HireNotFound/HireNotOwned/InvalidHireId to HireNotFound and takes the payment link from the fund submission only. - /hires/:id (HireDetailScreen + HireDetailView): polls every 4 s until the hire is final, keeps the last status with a Retry banner when a refresh fails, asks to connect or sign in (SEP-10) when needed, copies the result, opens the payment on StellarExpert. - The hire sheet's confirmed state gets "View hire". - Pages build: PULS3_HIRE sets the HIRE dart-define (server or demo). - Approve and Reject are not offered: they need the server-signed submit (#97). Refs #28
Deploying puls3 with
|
| Latest commit: |
85595d6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c4bbb85a.puls3-4lw.pages.dev |
| Branch Preview URL: | https://feat-28-hire-detail-screen.puls3-4lw.pages.dev |
5 tasks
This was referenced Oct 10, 2026
moises-cisneros
added a commit
that referenced
this pull request
Oct 10, 2026
…e with challenge checks, session on the Serverpod client) (#149) * feat(flutter): sign in with the wallet (SEP-10) before a real hire Since #147 the server only accepts hire calls from a wallet-bound session. The app only read the Freighter address, so with HIRE=server every hire ended in "Sign-in with your wallet is not available yet". It also could not sign the challenge: FreighterWallet.signTransaction requires every source to be the connected account (#69), but a SEP-10 challenge's source is the server. Wallet: - WalletPort.signChallenge(SignInChallenge), with assertSep10Challenge: sequence 0 (never submittable), only manage_data operations, the first one "<home domain> auth" from the connected account, every other one from the server (the transaction source, never the account), time bounds that include now, and the server key and home domain when the app knows them. After signing, the body must be unchanged and carry a new signature from the connected account (shared with signTransaction). - MockWallet and WalletController implement it. Session: - WalletSession: createChallenge, wallet signature, verifyChallenge, then the AuthSuccess is stored by the client's FlutterAuthSessionManager, which sends it on every call. A session is reused only for the wallet that opened it; a challenge issued for another wallet is never signed. - main.dart sets client.authSessionManager and reads serverSigningKey and homeDomain from config.json auth when the server publishes them. Hire flow: - HireGateway.ensureSignedIn / forgetSession (no-op in the demo). The flow signs in after connecting and before createHire (new step signingIn). A session the server refuses (NotAuthenticated, AuthenticationUnavailable) or a refused sign-in (ChallengeExpired, ChallengeConsumed, ChallengeNotFound, InvalidWalletSignature: HireSignInFailed) is dropped, so Try again signs in afresh. ChallengeRateLimited maps to "too many sign-in attempts". Tests: SEP-10 challenges built like the server's codec, signed by a real key through the fake Freighter bridge (valid, and every refusal); session reuse, wallet switch, wrong-wallet challenge, declined and refused sign-ins; the sheet signs in before createHire and recovers after a refusal; readAuthConfig. 267 app tests pass, web release build succeeds, and breaking each of the 10 guards fails a test. Refs #136 * feat(flutter): hire detail screen (S06) that polls getHire and shows the agent's result (#150) - HireGateway.getHire returns HireProgress (from HireDetail): escrow status, run status, failure reason, result and the fund tx. HireStage derives Funded/Queued/Running/Result ready/Run failed/Submitted/ Completed/Rejected (Cancelled from open)/Expired; a succeeded run that is still `running` with a result reads as Result ready. - ServerHireGateway maps HireNotFound/HireNotOwned/InvalidHireId to HireNotFound and takes the payment link from the fund submission only. - /hires/:id (HireDetailScreen + HireDetailView): polls every 4 s until the hire is final, keeps the last status with a Retry banner when a refresh fails, asks to connect or sign in (SEP-10) when needed, copies the result, opens the payment on StellarExpert. - The hire sheet's confirmed state gets "View hire". - Pages build: PULS3_HIRE sets the HIRE dart-define (server or demo). - Approve and Reject are not offered: they need the server-signed submit (#97). Refs #28 * fix(env): document PULS3_HIRE read by the Pages build script --------- Co-authored-by: Moises Cisneros <110249336+moises-cisneros@users.noreply.github.com> Co-authored-by: moises-cisneros <moisescisnerosdl@gmail.com>
This was referenced Oct 10, 2026
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #28 (deliverables 3 and 4). Stacked on #149, which handles the wallet sign-in
getHireneeds. Review #149 first; this PR's diff is only the S06 commit.What changes
HireGateway.getHire(hireId, consumer)→HireProgressServerHireGatewaycallsclient.hire.getHire. It mapsHireNotFound,HireNotOwnedandInvalidHireIdto the newHireNotFound,NotAuthenticatedtoHireNotSignedIn, and chain or persistence outages toHireBackendUnavailable.hire.paymentTransaction, or the latest submission when its purpose isfund. The explorer link is taken only from thatfundsubmission, never from acreateJoborsubmitone.HireStagederives what S06 shows fromstatus+runtimeStatus+result: awaitingPayment, queued, running, delivered, runFailed, submitted, completed, rejected, expired. A succeeded run staysrunningon the server until itssubmitlands, so funded + result reads as Result ready.isFinalis true for runFailed, completed, rejected and expired.FakeHireGateway(demo) creates no hire, sogetHirereturnsHireNotFound./hires/:id:HireDetailScreen(container) andHireDetailView(organism)open), Expired.failureReasonwhen it failed) → result recorded on Stellar → approved.ensureSignedIn, then it loads the hire. An unknown or foreign hire, or an id that is not a number, shows Hire not found and makes no call.Hire sheet: the confirmed state gets View hire, which closes the sheet and opens
/hires/<id>. The demo result never shows it.Pages:
scripts/cloudflare-pages-build.shpassesPULS3_HIREas--dart-define=HIRE=…. If it is unset, the build stays the labelled demo. The script test covers the new flag, and the server README says when to set it.Docs: screens.md and flows.md mark S06 as partly built (read-only).
Not in this PR
submit(feat(server): durable chain submission tracker with server-submitted escrow calls #97) is missing, so a hire never reachessubmitted; it stops at Result ready.Gates
dart format: no changes.flutter analyze: 0 issues.flutter test: 290 passed.flutter build web --release --dart-define=HIRE=server: OK.bash scripts/tests/cloudflare-pages-build.test.sh: 8/8.isFinal, cancel, fund-only link, HireNotOwned mapping, polling stop, wallet listener, invalid id, server explorer link, failed-run step, and last status kept on a refresh error.Demo use
PULS3_HIRE=serverandPULS3_API_URLin the Pages project.