Skip to content

Commit 2362bbb

Browse files
committed
Merge main into RFQ integration scenarios
Resolve the stacked PR branch after main advanced with legacy element gating and earlier RFQ/compliance work. Constraint: PR #28 must land after #27 and before live-Anvil E2E and CLI PRs. Confidence: high Scope-risk: narrow Directive: Continue stacked PR merges in order after #28 lands: #29, #30. Tested: git diff --check; git diff --cached --check Not-tested: full local scripts/check.sh for this progress-only reconciliation; rely on GitHub CI after push
2 parents 35025be + 29d6373 commit 2362bbb

20 files changed

Lines changed: 1307 additions & 108 deletions

DECISIONS.md

Lines changed: 48 additions & 3 deletions
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

@@ -310,7 +355,7 @@ RFQ venue의 다음 정책을 확정한다.
310355
- `src/execution/adapters/rfq/RFQAdapter.sol`
311356
- `FEATURES.md`
312357

313-
## D008 — Reg D 506(c) recipe를 9-element reference set으로 확장한다
358+
## D009 — Reg D 506(c) recipe를 9-element reference set으로 확장한다
314359

315360
Date: 2026-07-04
316361

@@ -380,7 +425,7 @@ criteria remain approval-gated").
380425
- `test/unit/compliance/Recipes.t.sol`, `test/unit/compliance/Engine.t.sol`
381426
- `docs/ROADMAP.md`
382427

383-
## D009 — Manifest lifecycle를 validated state machine로 만들고 engine을 default-deny로 닫는다
428+
## D010 — Manifest lifecycle를 validated state machine로 만들고 engine을 default-deny로 닫는다
384429

385430
Date: 2026-07-04
386431

FEATURES.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ 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.
@@ -192,13 +192,28 @@ passing
192192
SwapFlow, Engine)는 shared setup helper로 9-element attestation을 추가해 유지.
193193
- `forge fmt`.
194194

195+
## DOC-002 — RFQ SDK and MVP Demo Planning
196+
197+
### Behavior
198+
199+
- RFQ backend 운영을 Corner Store가 제공하지 않는다는 제품 경계를 명확히 한다.
200+
- RFQ backend SDK, local reference example, MVP demo backend를 서로 다른 레이어로 분리한다.
201+
- 구현 순서는 SDK interface 정리 → local reference example → MVP demo backend로 기록한다.
202+
- production RFQ hardening(dealer approval, custody, cancellation, partial fill)은 별도 트랙으로 유지한다.
203+
- roadmap과 product spec index에서 RFQ SDK/MVP backend 후속 작업을 찾을 수 있다.
204+
205+
### Verification
206+
207+
- RFQ venue architecture, product-spec index, roadmap, FEATURES, PROGRESS 교차 검토
208+
- `git diff --check`
209+
195210
### State
196211

197212
passing
198213

199214
### Notes
200215

201-
- 정책 결정: D008(9-element in-place 확장, operator-gated setter, Lockup은
216+
- 정책 결정: D009(9-element in-place 확장, operator-gated setter, Lockup은
202217
fixture-only mock acquisition source).
203218
- Deferred follow-up: ungated legacy mock element(A-01/A-03/QP)의 operator-gate
204219
정렬, production data source 연결, acquisition/lot data source와 holding-period
@@ -242,14 +257,38 @@ passing
242257
- 기존 registry lifecycle state-machine unit test(Task 1, 25 tests)는 유지.
243258
- `forge fmt`.
244259

260+
- Product spec: `docs/product-specs/rfq-backend-sdk-and-demo.md`
261+
- 이 feature는 문서 계획 작업이며 `services/rfq` 구현은 후속 feature에서 진행한다.
262+
263+
## RFQ-SDK-001 — RFQ Backend SDK Interfaces
264+
265+
### Behavior
266+
267+
- `services/rfq`가 RFQ backend를 만들기 위한 TypeScript SDK helper를 제공한다.
268+
- integrator는 `createRFQService(...).quote(...)` high-level API로 taker/token/amount/venue만 넣고 `RFQAdapter` 호환 signed quote를 받을 수 있다.
269+
- SDK는 EIP-712 typed-data shape, chainId/verifyingContract binding, nonce, expiry, amount validation과 signature flow를 처리한다.
270+
- signer, nonce store, pricing provider, inventory/risk check는 교체 가능한 interface로 제공한다.
271+
- local reference component는 `InMemoryNonceStore`, `FixedRatePricingProvider`, `NoopInventoryRiskCheck`로 제한한다.
272+
- production server, hosted backend, pricing strategy, signer custody, inventory management와 compliance final decision은 범위 밖이다.
273+
274+
### Verification
275+
276+
- `cd services/rfq && npm test`
277+
- `scripts/check.sh`
278+
- `git diff --check`
279+
245280
### State
246281

247282
passing
248283

249284
### Notes
250285

251-
- 정책 결정: D009(lifecycle state machine, enum-append, setStatus 제거, engine
286+
- 정책 결정: D010(lifecycle state machine, enum-append, setStatus 제거, engine
252287
positive-allowlist default-deny, clearUnregulated correction path, declaredBy=
253288
msg.sender와 factory consequence).
254289
- Non-goals: direction-aware element application, production onboarding governance
255290
key management.
291+
292+
- SDK README: `services/rfq/README.md`
293+
- Product spec: `docs/product-specs/rfq-backend-sdk-and-demo.md`
294+
- MVP demo backend는 이 SDK를 기반으로 후속 feature에서 구현한다.

PROGRESS.md

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ source of truth로 사용한다.
2525
- `CMP-002 — Manifest Lifecycle & Operator Approval Flow`(validated state machine,
2626
setStatus 제거, engine positive-allowlist default-deny, clearUnregulated,
2727
factory register→approve)
28+
- `DOC-002 — RFQ SDK and MVP Demo Planning`
29+
- `RFQ-SDK-001 — RFQ Backend SDK Interfaces`
2830
- multi-venue 아키텍처와 책임 문서 작성
2931
- Corner Store용 Uniswap v3 최소 배포 profile 분리와 테스트
3032
- ExecutionRouter/VenueRegistry/VenueSelector와 AMM reference adapter skeleton
@@ -33,7 +35,7 @@ source of truth로 사용한다.
3335
- RFQ-002: operator-curated maker approval allowlist(`setMakerApproved`,
3436
`RFQMakerNotApproved`), maker-initiated nonce-scoped idempotent cancellation
3537
(`cancelQuoteNonce`/`cancelQuoteNonces`, `RFQQuoteCancelled`), venueType binding
36-
fix, `docs/rfq-threat-model.md` 위협 모델과 D007 결정 기록
38+
fix, `docs/rfq-threat-model.md` 위협 모델과 D008 결정 기록
3739
- legacy mock element(Sanctions A-01, AccreditedInvestor A-03, QualifiedPurchaser
3840
A-13)의 attestation setter를 `Governed`/`onlyOperator` + 이벤트로 정렬해 CMP-001
3941
이후 hardening divergence를 닫았다(Lockup C-01은 settable mutator가 없어 변경 없음).
@@ -47,47 +49,30 @@ source of truth로 사용한다.
4749

4850
## Next
4951

50-
1. acquisition/lot data source와 holding-period Recipe 활성화 조건을 결정한다
52+
1. MVP RFQ demo backend milestone/user flow를 별도 문서·feature로 구체화한다.
53+
PR #29/#30이 머지되면 기존 live-Anvil E2E/CLI 경로를 재사용한다.
54+
2. pending RFQ/E2E/CLI/BUIDL PR stack(#29/#30/#35)이 머지된 뒤
55+
roadmap과 feature 상태를 재조정한다.
56+
3. 남은 RFQ production policy를 별도 feature로 분리한다: custody, partial fill,
57+
production dealer/operator 책임.
58+
4. acquisition/lot data source와 holding-period Recipe 활성화 조건을 결정한다
5159
(C-01 Lockup은 현재 fixture-only mock acquisition source).
52-
2. live Anvil deployment/E2E를 추가한다.
53-
3. Order Book은 matching/custody/surveillance 모델 결정 후 구현한다.
54-
4. CI hardening(static analysis 등)을 강화한다.
60+
5. Order Book은 matching/custody/surveillance 모델 결정 후 구현한다.
5561

5662
## Last Session Summary
5763

58-
- CMP-002 (Manifest Lifecycle & Operator Approval Flow)을 landing했다. Task 1
59-
(registry state machine)에 이어 Task 2에서 engine fail-open을 닫고 factory/seam
60-
finalization, 통합 시나리오, bookkeeping을 완료했다.
61-
- 변경한 파일:
62-
- product: `src/compliance/ComplianceEngine.sol`(evaluate positive-allowlist
63-
default-deny + commit 주석), `src/registry/TokenPolicyRegistry.sol` +
64-
`src/interfaces/compliance/ITokenPolicyRegistry.sol`(clearUnregulated),
65-
`src/factory/CornerStoreFactory.sol`(register→approve natspec)
66-
- test: `test/unit/compliance/Engine.t.sol`(신규 4 default-deny),
67-
`test/unit/registry/TokenPolicyRegistry.t.sol`(신규 8 clearUnregulated+auth),
68-
`test/integration/EmergencyPause.t.sol`(신규 3 router E2E),
69-
`test/integration/IntegrationBase.sol`/`Surveillance.t.sol`(seam 정리)
70-
- bookkeeping: `DECISIONS.md`(D009), `FEATURES.md`(CMP-002), `PROGRESS.md`
71-
- Task 1(앞선 커밋): `src/types/ComplianceTypes.sol`(enum append),
72-
`src/libraries/Errors.sol`(InvalidManifestTransition), registry state machine
73-
- TDD: engine 4개 default-deny 테스트가 먼저 RED로 오늘의 fail-open(PROPOSED/
74-
RETIRED × UNREGULATED/ACTIVE가 allowed=true)을 증명한 뒤 positive-allowlist로
75-
GREEN 전환.
76-
- 실행한 명령:
77-
- `forge fmt`
78-
- `forge test --offline`
79-
- 통과한 검증:
80-
- `forge test --offline` 227/227(pre-task 212 + 신규 15).
81-
- engine default-deny(양방향 ordering 포함), registry clearUnregulated +
82-
onlyOwner-vs-onlyOperator auth, 통합 PROPOSED/RETIRED reject + suspend→resume
83-
재거래.
64+
- #28 merge preparation includes RFQ protected-router integration scenarios on top of current main.
65+
- RFQFlow integration now covers router → compliance → RFQAdapter settlement plus maker-unapproved, cancellation, non-compliant buyer, and direct-call bypass scenarios.
66+
- RFQ-002, CMP-001, CMP-002, legacy gating, and RFQ-SDK records are preserved during this stacked merge reconciliation.
67+
- 실행한 검증:
68+
- original PR CI/checks passed before retarget
69+
- conflict reconciliation checked with `git diff --check`
8470
- 남은 리스크:
85-
- ungated legacy mock element(A-01/A-03/QP)와 새 operator-gated element 사이
86-
hardening divergence — follow-up으로 정렬(CMP-001 deferred).
87-
- C-01 Lockup은 fixture-only mock acquisition source에 의존; production
88-
acquisition/lot data source와 holding-period 활성화 default는 미결정.
89-
- production data source(OFAC/ONCHAINID/ERC-165/EDGAR) 연결과 legal 활성화는
90-
approval-gated로 열려 있다.
91-
- engine은 direction-aware가 아니다(기존 문서화된 concern).
92-
- production onboarding governance key management(factory ownership/multisig)는
93-
미결정.
71+
- MVP HTTP/CLI backend는 아직 구현하지 않았다.
72+
- production signer custody, persistent nonce store, pricing, inventory/risk는 integrator/operator 책임이다.
73+
- C-01 Lockup은 fixture-only mock acquisition source에 의존한다.
74+
75+
## RFQ-002 Merge Note
76+
77+
- RFQ-002 hardening from PR #24 is included in this branch update: maker approval, maker nonce cancellation, venueType binding, and RFQ threat-model documentation.
78+
- The deferred router-path maker-approval/cancellation integration coverage is completed by PR #28.

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)