Skip to content

Commit 8403198

Browse files
committed
Merge main into RFQ v2 hardening
Resolve the stacked PR branch after main advanced with the router venue binding fix, Phase 1 architecture baseline, and RFQ backend SDK documentation/code. Constraint: PR #24 must merge after #23 and before the higher stacked PRs. Rejected: Dropping either RFQ-002 or RFQ-SDK documentation state | both are accepted completed work on main/stack. Confidence: high Scope-risk: moderate Directive: Continue stacked PR merges in order after #24 lands: #25, #26, #27, #28, #29, #30. Tested: git diff --cached --check; scripts/check.sh Not-tested: GitHub CI after push
2 parents 25e894b + 391468d commit 8403198

20 files changed

Lines changed: 1336 additions & 96 deletions

DECISIONS.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,52 @@ Router 밖 경로는 production deployment에서 다음 중 하나로 처리해
255255
- `ARCHITECTURE.md`
256256
- `docs/architecture/execution-routing.md`
257257

258-
## D007 — RFQ v2 hardening: maker approval, full-fill, non-custodial, nonce-scoped cancel
258+
## D007 — PD-1~PD-7 Phase 1 architecture baseline을 확정한다
259+
260+
Date: 2026-07-14
261+
262+
### Context
263+
264+
Phase 1 구현 전에 Manifest schema, Recipe evaluation, post-trade state,
265+
identity claim, enforcement action, governance와 lifecycle record 보존 방식에
266+
대한 개발팀 합의가 필요했다.
267+
268+
이 결정들은 BUIDL-like demo나 RFQ/API 구현보다 상위의 아키텍처 baseline이다.
269+
270+
### Decision
271+
272+
PD-1~PD-7을 Phase 1 architecture baseline으로 확정한다.
273+
274+
- PD-1: Manifest는 explicit core + registry-backed `RecipeBinding` 구조를 사용한다.
275+
- PD-2: Router/Engine은 Manifest-level multi-Recipe binding 모델을 사용한다.
276+
- PD-3: token transfer 기준 acquisition timestamp와 router execution context를 분리하고, post-trade commit은 idempotent하게 처리한다.
277+
- PD-4: investor qualification은 ERC-3643/ONCHAINID claim pipeline을 기본 인터페이스로 사용하고, Securitize/TA는 adapter boundary로 연동한다.
278+
- PD-5: `BLOCK`, `FLAG_ONLY`, `OPERATOR_REVIEW` 중심의 enforcement action 모델과 constrained override를 사용한다.
279+
- PD-6: governance authority는 외부 Safe-style multisig를 사용하고, compliance relaxation은 timelock을 요구한다.
280+
- PD-7: Manifest lifecycle은 semantic versioning, append-only history, central pause state와 hash-anchored record preservation을 사용한다.
281+
282+
### Alternatives Considered
283+
284+
- PD별 ADR을 7개로 분리: 현재 결정들이 하나의 Phase 1 구조 freeze를 구성하므로
285+
단일 baseline ADR로 묶는 편이 리뷰와 추적에 더 적합해 보류한다.
286+
- 현행 `issuanceRecipeId + fundRecipeId` 구조 유지: BUIDL-like demo에는 충분하지만
287+
future policy 조합과 path option을 표현하기 어려워 transitional 구조로만 남긴다.
288+
- Corner Store 전용 identity model 신설: ERC-3643/T-REX와 ONCHAINID 호환성을
289+
해치고 TA/KYC provider 연동성이 떨어져 제외한다.
290+
291+
### Consequences
292+
293+
- PD-1~PD-7은 더 이상 열린 구조 질문이 아니며, 후속 작업은 구현 명세와 migration issue로 진행한다.
294+
- 현재 코드의 transitional 구조는 별도 implementation branch에서 `RecipeBinding[]`, compiled plan, lifecycle registry 등으로 이전해야 한다.
295+
- 실제 Securitize/TA 연동은 공식/current interface 확인 후 별도 refinement issue에서 처리한다.
296+
297+
### Related Files
298+
299+
- `docs/decisions/ADR-007-pd-architecture-decisions.md`
300+
- `docs/decisions/decision-register.md`
301+
- `docs/architecture/phase1-structural-decisions-proposed.md`
302+
303+
## D008 — RFQ v2 hardening: maker approval, full-fill, non-custodial, nonce-scoped cancel
259304

260305
Date: 2026-07-04
261306

FEATURES.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,60 @@ passing
151151

152152
### Notes
153153

154-
- 정책 결정: D007(maker approval adapter-local, full-fill, non-custodial,
154+
- 정책 결정: D008(maker approval adapter-local, full-fill, non-custodial,
155155
nonce-scoped idempotent cancel).
156156
- Non-goals: partial fill, dealer inventory, signer key custody, shared dealer
157157
registry.
158158
- Deferred follow-up: router-path maker-approval/cancellation integration-test
159159
시나리오.
160+
161+
## DOC-002 — RFQ SDK and MVP Demo Planning
162+
163+
### Behavior
164+
165+
- RFQ backend 운영을 Corner Store가 제공하지 않는다는 제품 경계를 명확히 한다.
166+
- RFQ backend SDK, local reference example, MVP demo backend를 서로 다른 레이어로 분리한다.
167+
- 구현 순서는 SDK interface 정리 → local reference example → MVP demo backend로 기록한다.
168+
- production RFQ hardening(dealer approval, custody, cancellation, partial fill)은 별도 트랙으로 유지한다.
169+
- roadmap과 product spec index에서 RFQ SDK/MVP backend 후속 작업을 찾을 수 있다.
170+
171+
### Verification
172+
173+
- RFQ venue architecture, product-spec index, roadmap, FEATURES, PROGRESS 교차 검토
174+
- `git diff --check`
175+
176+
### State
177+
178+
passing
179+
180+
### Notes
181+
182+
- Product spec: `docs/product-specs/rfq-backend-sdk-and-demo.md`
183+
- 이 feature는 문서 계획 작업이며 `services/rfq` 구현은 후속 feature에서 진행한다.
184+
185+
## RFQ-SDK-001 — RFQ Backend SDK Interfaces
186+
187+
### Behavior
188+
189+
- `services/rfq`가 RFQ backend를 만들기 위한 TypeScript SDK helper를 제공한다.
190+
- integrator는 `createRFQService(...).quote(...)` high-level API로 taker/token/amount/venue만 넣고 `RFQAdapter` 호환 signed quote를 받을 수 있다.
191+
- SDK는 EIP-712 typed-data shape, chainId/verifyingContract binding, nonce, expiry, amount validation과 signature flow를 처리한다.
192+
- signer, nonce store, pricing provider, inventory/risk check는 교체 가능한 interface로 제공한다.
193+
- local reference component는 `InMemoryNonceStore`, `FixedRatePricingProvider`, `NoopInventoryRiskCheck`로 제한한다.
194+
- production server, hosted backend, pricing strategy, signer custody, inventory management와 compliance final decision은 범위 밖이다.
195+
196+
### Verification
197+
198+
- `cd services/rfq && npm test`
199+
- `scripts/check.sh`
200+
- `git diff --check`
201+
202+
### State
203+
204+
passing
205+
206+
### Notes
207+
208+
- SDK README: `services/rfq/README.md`
209+
- Product spec: `docs/product-specs/rfq-backend-sdk-and-demo.md`
210+
- MVP demo backend는 이 SDK를 기반으로 후속 feature에서 구현한다.

PROGRESS.md

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ source of truth로 사용한다.
2020
- `FND-001 — Foundry Product Foundation`
2121
- `RFQ-001 — Reference RFQ Settlement`
2222
- `RFQ-002 — RFQ v2 Hardening`
23+
- `DOC-002 — RFQ SDK and MVP Demo Planning`
24+
- `RFQ-SDK-001 — RFQ Backend SDK Interfaces`
2325
- multi-venue 아키텍처와 책임 문서 작성
2426
- Corner Store용 Uniswap v3 최소 배포 profile 분리와 테스트
2527
- ExecutionRouter/VenueRegistry/VenueSelector와 AMM reference adapter skeleton
@@ -28,47 +30,59 @@ source of truth로 사용한다.
2830
- RFQ-002: operator-curated maker approval allowlist(`setMakerApproved`,
2931
`RFQMakerNotApproved`), maker-initiated nonce-scoped idempotent cancellation
3032
(`cancelQuoteNonce`/`cancelQuoteNonces`, `RFQQuoteCancelled`), venueType binding
31-
fix, `docs/rfq-threat-model.md` 위협 모델과 D007 결정 기록
33+
fix, `docs/rfq-threat-model.md` 위협 모델과 D008 결정 기록
3234

3335
## Blocked
3436

3537
- 없음
3638

3739
## Next
3840

39-
1. Compliance module buildout을 최우선으로 진행한다(사용자/steering 결정):
40-
reference Reg D 506(c) set을 향한 Element library → Recipe 확장 → Manifest
41-
lifecycle/operator approval flow.
42-
2. RFQ integration-test 시나리오(router-path maker-approval/cancellation coverage)를
43-
추가한다 — 이번 feature에서 deferred된 follow-up.
44-
3. acquisition/lot data source와 holding-period Recipe 활성화 조건을 결정한다.
45-
4. live Anvil deployment/E2E를 추가한다.
46-
5. Order Book은 matching/custody/surveillance 모델 결정 후 구현한다.
47-
6. CI hardening(static analysis 등)을 강화한다.
41+
1. MVP RFQ demo backend milestone/user flow를 별도 문서·feature로 구체화한다.
42+
PR #29/#30이 머지되면 기존 live-Anvil E2E/CLI 경로를 재사용한다.
43+
2. pending RFQ/E2E/CLI/BUIDL PR stack(#24/#28/#29/#30/#35)이 머지된 뒤
44+
roadmap과 feature 상태를 재조정한다.
45+
3. 남은 RFQ production policy를 별도 feature로 분리한다: custody, partial fill,
46+
production dealer/operator 책임.
47+
4. production Asset Compliance Manifest lifecycle/schema와 operator approval flow를
48+
구현한다.
49+
5. acquisition/lot data source와 holding-period Recipe 활성화 조건을 결정한다.
50+
6. Order Book은 matching/custody/surveillance 모델 결정 후 구현한다.
4851

4952
## Last Session Summary
5053

51-
- 변경한 파일(docs/bookkeeping only, 이번 세션):
52-
- `docs/rfq-threat-model.md`(신규 위협 모델)
53-
- `docs/security.md`(RFQ Safety에 위협 모델 링크)
54-
- `docs/README.md`(doc index 항목)
55-
- `DECISIONS.md`(D007), `FEATURES.md`(RFQ-002), `PROGRESS.md`
56-
- 앞선 코드 세션(RFQ-002)에서 landed:
57-
- RFQAdapter maker approval gate(`setMakerApproved`, `approvedMaker`,
58-
`RFQMakerNotApproved`), maker-initiated cancellation(`cancelQuoteNonce`,
59-
`cancelQuoteNonces`, `RFQQuoteCancelled`), router venueType binding fix
60-
- RFQAdapter/Router Foundry tests(9 RFQ + 1 router venueType)
61-
- 실행한 명령:
62-
- `forge fmt`
63-
- `forge test --offline`
54+
- 변경한 파일:
55+
- `services/rfq/src/types.ts`
56+
- `services/rfq/src/quoteService.ts`
57+
- `services/rfq/src/reference.ts`
58+
- `services/rfq/src/validation.ts`
59+
- `services/rfq/src/index.ts`
60+
- `services/rfq/test/smoke.ts`
61+
- `services/rfq/README.md`
62+
- `services/rfq/package.json`
63+
- `README.md`
64+
- `docs/architecture/venues/README.md`
65+
- `docs/product-specs/rfq-backend-sdk-and-demo.md`
66+
- `docs/product-specs/index.md`
67+
- `docs/testing.md`
68+
- `FEATURES.md`
69+
- `PROGRESS.md`
70+
- 완료한 작업:
71+
- low-level `RFQQuoteService.createSignedQuote` 호환성을 유지하면서 high-level `createRFQService(...).quote(...)` API 추가
72+
- signer, nonce store, pricing provider, inventory/risk check interface 추가
73+
- local/demo reference component(`InMemoryNonceStore`, `FixedRatePricingProvider`, `NoopInventoryRiskCheck`) 추가
74+
- address, chainId, TTL, on-chain integer validation helper 분리
75+
- SDK quick start와 production responsibility boundary 문서화
76+
- smoke test를 SDK quote flow, nonce uniqueness, unsafe number, invalid request, risk reject-before-signing까지 확장
77+
- 실행한 검증:
6478
- `cd services/rfq && npm test`
65-
- 통과한 검증:
66-
- `forge test --offline` 133/133 유지(이번 task는 코드 변경 없음)
67-
- RFQ service smoke check
68-
- `docs/rfq-threat-model.md` 존재와 링크 무결성
79+
- `scripts/check.sh`
6980
- 남은 리스크:
70-
- signer key custody와 operator key management(multisig/HSM/rotation)은 open
71-
decision이다.
72-
- partial fill, dealer inventory, shared dealer registry는 범위 밖이다.
73-
- cancel-vs-fill race는 first-lander로 해소되며 cancel은 확정 전까지 best-effort다.
74-
- RFQ router-path integration-test 시나리오는 deferred follow-up이다.
81+
- 아직 MVP HTTP/CLI backend는 구현하지 않았다.
82+
- production signer custody, persistent nonce store, pricing, inventory/risk는 integrator/operator 책임이다.
83+
- pending PR #24/#28/#29/#30/#35 merge 이후 roadmap/feature 상태 재조정이 필요하다.
84+
85+
## RFQ-002 Merge Note
86+
87+
- RFQ-002 hardening from PR #24 is included in this branch update: maker approval, maker nonce cancellation, venueType binding, and RFQ threat-model documentation.
88+
- Deferred follow-up remains router-path maker-approval/cancellation integration-test coverage after stacked PRs are reconciled.

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,14 @@ forge fmt
9797
anvil
9898
```
9999

100-
### RFQ Reference Service
101-
102-
`services/rfq` is a minimal quote signer reference for RFQ v1. It builds the
103-
same EIP-712 typed data that `RFQAdapter` verifies, assigns expiry and nonce,
104-
and returns a signed quote. It is not a production dealer, pricing engine,
105-
inventory manager, custody service, websocket feed, orderbook, or compliance
106-
decision engine.
100+
### RFQ TypeScript SDK
101+
102+
`services/rfq` provides TypeScript SDK helpers for RFQ quote backends. It builds
103+
the same EIP-712 typed data that `RFQAdapter` verifies, assigns expiry and
104+
nonce, signs quotes through a caller-provided signer, and exposes pricing, nonce
105+
and risk-check interfaces for integrators. It is not a hosted production RFQ
106+
server, dealer, pricing engine, inventory manager, custody service, websocket
107+
feed, orderbook, or compliance decision engine.
107108

108109
```shell
109110
cd services/rfq

docs/ROADMAP.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ Deliverables:
251251
- signature, nonce, expiry와 taker binding
252252
- Router-only RFQ Adapter와 latest compliance evaluation
253253
- 최소 TypeScript quote signer reference service
254+
- RFQ backend SDK interface와 local reference example 계획은 `docs/product-specs/rfq-backend-sdk-and-demo.md`를 따른다.
255+
- MVP demo backend는 SDK 정리 이후 별도 feature로 구현한다.
254256
- partial fill policy는 v1 non-goal로 유지
255257

256258
Completion:
@@ -317,16 +319,27 @@ SDK와 reference DEX를 반복 배포하고 Manifest/권한 상태를 검증 가
317319

318320
## Near-Term Issues
319321

322+
Open PR context:
323+
324+
- #24 covers RFQ maker approval and quote cancellation hardening.
325+
- #28 covers protected-router RFQ integration scenarios.
326+
- #29 covers live-Anvil E2E/demo runner.
327+
- #30 covers interactive CLI over the deployed demo stack.
328+
- #35 covers BUIDL-like ERC-3643 compliance fixture with mock TA facts.
329+
320330
가까운 후속 이슈:
321331

322-
1. `design(rfq): dealer/operator approval, custody, cancellation, partial-fill policy 확정`
323-
2. `security(rfq): direct venue, signer, custody, replay, quote-cancellation threat model 작성`
324-
3. `feat(compliance): production Asset Compliance Manifest lifecycle/schema 구현`
325-
4. `design(compliance): acquisition/lot data source와 holding-period Recipe 활성화 조건 결정`
326-
5. `test(e2e): live Anvil deployment와 regulated RFQ/AMM settlement smoke 자동화`
327-
6. `feat(orderbook): matching/custody/surveillance 모델 결정 후 Order Book adapter 구현`
328-
7. `chore(ci): deploy-v3 CI, static analysis, lint/warning budget 추가`
329-
8. `docs(ops): Manifest activation/suspension runbook과 incident drill 문서화`
332+
1. `feat(rfq): add TypeScript SDK interfaces for quote backend integration`
333+
2. `docs(demo): define MVP RFQ backend milestone and user flow`
334+
3. `feat(demo): add MVP RFQ backend using the RFQ SDK` — PR #29/#30이 머지되면 해당 E2E/CLI 경로를 재사용한다.
335+
4. `docs(roadmap): reconcile roadmap after pending RFQ/E2E/CLI/BUIDL PR stack merges`
336+
5. `design(rfq): remaining production RFQ policy beyond PR #24` — custody, partial fill, production dealer/operator 책임.
337+
6. `security(rfq): direct venue, signer custody, replay, quote-cancellation threat model 보강`
338+
7. `feat(compliance): production Asset Compliance Manifest lifecycle/schema 구현`
339+
8. `design(compliance): acquisition/lot data source와 holding-period Recipe 활성화 조건 결정`
340+
9. `feat(orderbook): matching/custody/surveillance 모델 결정 후 Order Book adapter 구현`
341+
10. `chore(ci): static analysis, lint/warning budget 추가`
342+
11. `docs(ops): Manifest activation/suspension runbook과 incident drill 문서화`
330343

331344
## Decision Backlog
332345

0 commit comments

Comments
 (0)