Skip to content

feat(server): escrow relay protocol models, migration and config (#96) - #123

Closed
moises-cisneros wants to merge 3 commits into
feat/96-escrow-relayfrom
feat/96-escrow-relay-01-protocol
Closed

moises-cisneros wants to merge 3 commits into
feat/96-escrow-relayfrom
feat/96-escrow-relay-01-protocol

Conversation

@moises-cisneros

@moises-cisneros moises-cisneros commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Refs #96

Part of the chain that replaces #119, split after its review. Tracker: #122.

Summary

Protocol models (PreparedTransaction, CreateHireResult, HireDetail, Hire, Payment, Puls3ApiException), the escrow_preparation table, the new hire columns, the relay configuration and the session wallet port. Also the CI fixes from the review of #119: the three new variables in .env.example and narrow gitleaks allowlists.

Acceptance criteria

The chain as a whole covers #96; this PR carries its slice (see Scope below).

  • The app can create and fund a hire on testnet using only prepare… and submitEscrowCall (proven in the docs PR)
  • A signed envelope that differs from its preparation in any field is rejected
  • A caller can never prepare or submit for a hire that is not theirs
  • A submit… call never throws for chain outcomes
  • Each preparation has at most one ChainSubmission

Verification evidence

dart analyze --fatal-infos
dart test test/protocol
bash scripts/tests/env-inventory.test.sh   -> 71 passed
gitleaks over the whole chain tree        -> no leaks

Notes for reviewers

  • Review against the parent branch (feat/96-escrow-relay), not main.
  • Over the 400 line budget: 476 authored lines, mostly tests of code that moves funds. It is one cohesive unit and cannot shrink without dropping tests, so it needs size:exception.
  • Generated code, migrations and recorded fixtures are excluded from the authored count.

Chain Context

Field Value
Chain Escrow relay prepare and submit endpoints (#96)
Tracker PR #122
Position 1 of 12
Base feat/96-escrow-relay
Depends on #122 (tracker)
Follow-up #124
Review budget 476 authored (9704 total) / 400
Starts at feat/96-escrow-relay
Ends with Models, generated code, migration, HireRelayConfig, SessionWallet, .env.example, .gitleaks.toml.

Chain Overview

main
 └── #122 Tracker (draft, no merge)
      └── 📍 #123 protocol
           └── #124 xdr-encoder
                └── #125 stellar-codec
                     └── #126 rpc-client
                          └── #127 preparation-store
                               └── #128 hire-lifecycle
                                    └── #129 prepare
                                         └── #130 submit
                                              └── #131 hire-service
                                                   └── #132 endpoint
                                                        └── #133 docs
                                                             └── #134 openspec

Scope

  • Includes: Models, generated code, migration, HireRelayConfig, SessionWallet, .env.example, .gitleaks.toml.
  • Excludes: Codec, RPC, stores, services, endpoint, docs.

Autonomy

  • CI is expected to pass for this PR branch
  • This PR has one deliverable scope
  • This PR can be rolled back without unrelated changes
  • Tests, docs, or manual verification cover this unit

Narrow rules scoped by file path and line shape for env var name constants, generated class-name lookups and recorded ledger keys. Migrates the existing allowlist to [[allowlists]], which cannot be mixed with the deprecated [allowlist].
Adds PreparedTransaction, CreateHireResult, HireDetail, Hire, Payment and Puls3ApiException, the escrow_preparation table and the requestId, input and jobId columns of hire. Part of #96.
Reads the preparation validity, inclusion fee and platform fee from the environment with no defaults (ADR-0005 D3). Documents the keys in .env.example. Part of #96.
@moises-cisneros

Copy link
Copy Markdown
Contributor Author

Folded into #126 to keep the chain at 4 PRs. The commits are the same, just grouped; this branch stays in the history of #126.

@moises-cisneros
moises-cisneros deleted the feat/96-escrow-relay-01-protocol branch October 8, 2026 17:03

@TOMOKI977 TOMOKI977 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved. This slice is part of the code I reviewed in full on #119 at b0a4adc (all four lenses; see the review there). I checked that the tip of the chain matches b0a4adc except for the CI fix in .env.example and .gitleaks.toml (and main's #112). The follow-ups listed on #119 apply to the chain as a whole.

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.

2 participants