Skip to content

Commit f8d1afd

Browse files
committed
Merge main into legacy element gating
Resolve the stacked PR branch after main advanced with the manifest lifecycle, Reg D compliance, RFQ hardening, and RFQ SDK work. Constraint: PR #27 must land after #26 and before RFQ integration/E2E/CLI PRs. Confidence: high Scope-risk: narrow Directive: Continue stacked PR merges in order after #27 lands: #28, #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 c3e0d1e + de85b6e commit f8d1afd

20 files changed

Lines changed: 1307 additions & 110 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.
@@ -191,13 +191,28 @@ passing
191191
SwapFlow, Engine)는 shared setup helper로 9-element attestation을 추가해 유지.
192192
- `forge fmt`.
193193

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

196211
passing
197212

198213
### Notes
199214

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

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

246281
passing
247282

248283
### Notes
249284

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

PROGRESS.md

Lines changed: 25 additions & 42 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가 없어 변경 없음).
@@ -44,49 +46,30 @@ source of truth로 사용한다.
4446

4547
## Next
4648

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

5559
## Last Session Summary
5660

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