Skip to content

feat: add single-stage underwriting hook#25

Open
tsubasakong wants to merge 1 commit intoerc-8183:mainfrom
tsubasakong:split/underwriting-hook-core
Open

feat: add single-stage underwriting hook#25
tsubasakong wants to merge 1 commit intoerc-8183:mainfrom
tsubasakong:split/underwriting-hook-core

Conversation

@tsubasakong
Copy link
Copy Markdown

@tsubasakong tsubasakong commented Apr 14, 2026

Summary

  • add an experimental single-stage UnderwritingHook that commit-locks underwriting terms on setBudget(...)
  • add UnderwritingEvaluator for registered-underwriter EIP-712 complete/reject relays after evidence submission
  • document the hook as a Profile C example without the parent/close workflow scaffold

Why

  • this extracts the more generic hook piece from #16: a single-stage underwriter-gated completion flow that fits the existing ACP lifecycle
  • it intentionally omits the parent/close linkage, coordinator, and larger workflow scaffold so the hook reads as a smaller lego block

Explicitly out of scope

  • parent/close linkage
  • active close slot management
  • AwaitingClose state
  • UnderwritingCoordinator
  • workflow-only hook surface such as setWiring(...), markProtected(...), jobSettlementJobId(...), isAwaitingClose(...), getParentJobId(...), and getActiveCloseJobId(...)

Workflow-heavy follow-up

  • the remaining two-stage parent/close workflow scaffold is intended for the separate public companion repo: https://github.com/tsubasakong/underwriting-settlement-contracts
  • that follow-up should carry the workflow-specific coordinator/orchestration code and any larger sequence documentation, rather than expanding hook-contracts

Validation

  • forge build --force
  • local temporary flow validation covered:
    • single-stage root flow completes with a valid underwriter signature
    • submit rejects when evidence terms do not match the committed underwriting terms

@tsubasakong tsubasakong force-pushed the split/underwriting-hook-core branch from 09b2fc5 to 630743c Compare April 14, 2026 23:41
@tsubasakong tsubasakong changed the title [codex] feat: add single-stage underwriting hook feat: add single-stage underwriting hook Apr 14, 2026
@tsubasakong
Copy link
Copy Markdown
Author

Follow-up note: the workflow-heavy two-stage underwriting scaffold now lives in the public companion repo here:
https://github.com/tsubasakong/underwriting-settlement-contracts

That repo now contains the self-contained workflow package (TwoStageUnderwritingHook / WorkflowCore / Evaluator / Coordinator), workflow-focused docs, and Foundry tests.

So the intended split is now concrete:

  • #24 stays the foundational BaseACPHook / setBudget routing fix
  • #25 stays the smaller single-stage underwriting hook surface in hook-contracts
  • the larger parent/close settlement workflow continues in the companion repo above

@tsubasakong tsubasakong marked this pull request as ready for review April 15, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant