name: protocol-sync-review
description: Review this monorepo for cross-package consistency, interface compatibility, event stability, and configuration alignment. Use when validating that oracle, insurance consumer, policy engine, vault, workflows, and frontend remain synchronized.
Protocol Sync Review
Use this workflow to catch integration drift before runtime failures.
Primary objective
Detect mismatches between:
- Solidity interfaces and implementations
- Event names, field order, and indexed fields
- Decimal and unit assumptions (
priceUsdE8, USDC e6, wei)
- Feed key hashing conventions
- Workflow/frontend expectations versus on-chain APIs
Review targets
requirements.md
README.md
policy-engine/contracts/src
vault/contracts/src
chainlink-cre-car-price-oracle/contracts/src
chainlink-cre-car-value-insurance/contracts/src
chainlink-cre-car-price-oracle/car-price-oracle-workflow
chainlink-cre-car-value-insurance/insurance-workflow
frontend
Locked protocol assumptions
Treat these as stable until the team intentionally revises the spec:
feedKeyHash = keccak256(bytes(feedKeyString))
- Oracle struct shape:
priceUsdE8 uint128
sampleSize uint32
confidenceBps uint32
updatedAt uint64
sourceHash bytes32
PolicyPurchased and PolicyClaimed event names and argument order.
- Policy identifier rule:
tokenId == policyId.
- Policy manager API shape:
buyPolicy(bytes32,uint128,uint256,uint64)
triggerPayout(uint256)
getPolicy(uint256)
isActive(uint256)
Drift checks
- Flag interface signature mismatches between contracts and interfaces.
- Flag payout semantic mismatches across docs/contracts/tests.
- Flag ETH-versus-USDC assumption mismatches.
- Flag event type or ordering drift from locked spec.
- Flag stale addresses, wrong chain targets, or missing config linkage.
Output contract
Return:
Critical integration breaks (causes failed tx or invalid runtime behavior).
Spec drift (not yet broken but no longer aligned).
Decision-needed items requiring team alignment.
Patch plan with exact files to change.