# Complete - m-multi-provider-protocol-profile-native-messages/01_protocol_core

## Completion Time

2026-08-01

## Summary

Completed the protocol-profile core contract after three review loops; final verdict: PASS.

## Loop History

| Plan | Review | Verdict | Notes |
|------|--------|---------|-------|
| `plan_local_G08_01.log` | `code_review_cloud_G08_01.log` | FAIL | The initial implementation left six production contract, immutability, integration-test, and generated-consumer gaps. |
| `plan_cloud_G09_01.log` | `code_review_cloud_G09_01.log` | FAIL | Five boundary defects remained in operation admission, refresh classification, adapter-backed compilation, raw JSON preservation, and auth validation. |
| `plan_cloud_G09_02.log` | `code_review_cloud_G09_02.log` | PASS | All carried findings were closed and independently verified across focused, full-suite, generated-consumer, and fake-upstream paths. |

## Implementation/Cleanup

- Added immutable built-in/custom protocol-profile resolution, validation, operation URL resolution, model mapping, auth declarations, and token-counter configuration.
- Carried concrete profiles through Edge admission, dispatch metadata, protobuf mapping, Node adapter construction, and operation-aware tunnel execution.
- Filtered operation-incompatible concrete profiles before initial queue admission and every re-resolution while preserving nil-profile legacy fallback.
- Classified profile catalog/provider selector changes as restart-required and token-counter changes as applied without mutating the live runtime on rejected refreshes.
- Compiled adapter-backed profile providers into provider-id-keyed OpenAI-compatible Node adapters while retaining their referenced legacy adapters.
- Preserved all non-model request JSON bytes during model mapping and enforced RFC 9110 field-name token syntax plus the current MiniMax/MiMo auth matrix.

## Final Verification

- Focused operation-admission, refresh-classification/apply, adapter-backed profile, raw-body preservation, header-token, and actual auth-request Go commands - PASS.
- `IOP_LEMONADE_MODE=fake ./scripts/e2e-openai-lemonade.sh` - PASS; the full Edge-to-Node adapter-backed fake-upstream cycle satisfied path, auth, model, and request-count assertions.
- `make proto` and `make proto-dart` - PASS; generated Go and Dart consumers are synchronized.
- `go test -count=1 ./packages/go/... -skip 'TestCLIWorkspacePreflightFailures|TestSerialIntegratorRestartRecoversInterruptedApplyByRollback'` - PASS; this is the documented replacement for unrelated local permission/restart fixtures.
- `go test -count=1 ./apps/edge/...` and `go test -count=1 ./apps/node/...` - PASS.
- `cd apps/client && flutter test test/iop_wire/generated_proto_import_test.dart` - PASS.
- `git diff --check` - PASS.

## Roadmap Completion

- Milestone: `agent-roadmap/phase/operational-observability-provider-management/milestones/multi-provider-protocol-profile-native-messages.md`
- Milestone link: [Milestone document](agent-roadmap/phase/operational-observability-provider-management/milestones/multi-provider-protocol-profile-native-messages.md)
- Completed task ids:
  - `profile-contract`: PASS; evidence=`agent-task/archive/2026/08/m-multi-provider-protocol-profile-native-messages/01_protocol_core/plan_cloud_G09_02.log`, `agent-task/archive/2026/08/m-multi-provider-protocol-profile-native-messages/01_protocol_core/code_review_cloud_G09_02.log`; verification=focused config/Edge/Node profile tests, full Edge/Node suites, and fake Lemonade full-cycle.
  - `path-resolution`: PASS; evidence=`agent-task/archive/2026/08/m-multi-provider-protocol-profile-native-messages/01_protocol_core/plan_cloud_G09_02.log`, `agent-task/archive/2026/08/m-multi-provider-protocol-profile-native-messages/01_protocol_core/code_review_cloud_G09_02.log`; verification=operation URL, admission, raw-body, actual request, and fake Lemonade tests.
  - `profile-catalog`: PASS; evidence=`agent-task/archive/2026/08/m-multi-provider-protocol-profile-native-messages/01_protocol_core/plan_cloud_G09_02.log`, `agent-task/archive/2026/08/m-multi-provider-protocol-profile-native-messages/01_protocol_core/code_review_cloud_G09_02.log`; verification=catalog/header/auth matrix tests, refresh tests, and generated-consumer regression.
- Not completed task ids: None.

## Remaining Nits

- None.

## Follow-up Work

- None.
