feat(negotiation): complete proposal refinement API gaps - #38
Conversation
Introduces the `negotiation` package across adcp, adcp-server, and adcp-testing modules for the refine_proposals tool surface (AdCP 3.2). Client (adcp module): - Sealed RefinementResult with four outcomes (revised/partial/finalized/unable) supporting exhaustive pattern matching - Capability-aware RefineProposalsRequest builder enforcing batch size ceilings, unique proposal IDs, and finalize-only homogeneity - Three typed constraints from the 3.2 delta: CpmConstraint, ImpressionsConstraint, FlightConstraint - TermsDigest utility implementing RFC 8785 JCS canonicalization for SHA-256 digest computation and verification - ResponseVerifier checking result ordering, lineage (parent_proposal_id), finalize atomicity, outcome structural constraints, partial invariant, unique alternatives, and digest integrity - AdcpClient.refineProposals() convenience method - UnsupportedRefinementDetails for typed UNSUPPORTED_FEATURE error recovery - RefinementCapability with product_changes dimension key (post-rename) Server (adcp-server module): - ProposalHandler interface with capability declaration, batch preflight hook, and refine callback — commercial decisions stay in the application Testing (adcp-testing module): - NegotiationFixtures with factory methods for common scenarios: single revise, batch finalize, constraint objects, draft/committed proposals Covers the unsatisfied_constraints-is-open-strings design, reason code precedence (constraint_unsatisfiable > commercially_declined), lineage verification, and the hold_unavailable/batch_aborted reason codes from the post-red-team protocol delta. Ref: adcontextprotocol#36
- TermsDigest: remove unused MAPPER field and three unused imports (JsonProcessingException, Iterator, Map) - TermsDigest: add @nullable to verify() digest parameter — the method handles null but the @NullMarked package default says non-null - TermsDigest: fix JCS exponent formatting — strip ".0" before 'e' so 1.0E-7 becomes "1e-7" per ES2015/RFC 8785 (was producing "1.0e-7") - TermsDigest: replace per-character OutputStreamWriter allocation in writeCanonicalString with direct String.valueOf(c).getBytes() - RefineProposalsRequest: remove unused Collections import and dead supportedDimensions builder field (stored but never validated) - AdcpClient: fix import ordering — negotiation imports grouped with other org.adcontextprotocol imports, not after slf4j - Add serialization round-trip test for RefinementResult - Add test coverage for JCS exponent edge cases
Add missing typed constraints, alternatives validation, and server-side successor utilities to close the proposal negotiation gaps tracked in adcontextprotocol/adcp#6556. - TotalBudgetConstraint: budget bounds (min/max/currency) per schema - RefinementConstraints: composite of all four constraint dimensions - ProposalRefinement: add constraints, productChanges, alternatives fields + builder; rename instructions→ask to match wire schema; enforce alternatives.count 2-10 (protocol max) - RefinementCapability: add maxAlternatives field - RefineProposalsRequest.Builder: validate alternatives against seller ceiling - ResponseVerifier: add verifyConstraintSatisfaction checking budget bounds and CPM ceiling on revised outcomes - ProposalSuccessor (server): stamp immutable successors with lineage and recomputed terms_digest - 15 new tests across constraints, alternatives, verification, and successor stamping Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The automated review encountered an issue (possibly reached max turns, timed out, or failed to post the final This is an automated message from the Argus AI review workflow. |
|
This is a useful core start, but it does not yet meet #36's RC acceptance criteria. I found four concrete blockers in the current diff:
Please also map the |
|
Maintainer takeover update pushed in
Verification: |
|
The automated review encountered an issue (possibly reached max turns, timed out, or failed to post the final This is an automated message from the Argus AI review workflow. |
bokelley
left a comment
There was a problem hiding this comment.
Maintainer review complete after the takeover commit. The implementation now satisfies the issue acceptance criteria: beta.9 model shapes, reference JCS canonicalization, fail-closed response verification, fresh successor identities, atomic finalize execution, server/client integrations, testing fixtures, CLI exercise, and documentation. Full multi-module Gradle build passes locally.
bokelley
left a comment
There was a problem hiding this comment.
Re-review complete after the CI metadata fix. The new private workspace manifests only register the eight Gradle artifacts with Changesets; npx changeset status --since=origin/main now identifies the seven affected artifacts and the full Gradle build remains green.
|
The automated review encountered an issue (possibly reached max turns, timed out, or failed to post the final This is an automated message from the Argus AI review workflow. |
bokelley
left a comment
There was a problem hiding this comment.
Final re-review complete. Clean-install validation now passes: npm ci, npx changeset status --since=origin/main (seven minor artifact entries), the full Gradle build, and git diff --check are all green.
Summary
Completes the Java/Kotlin client, seller, testing, and example surfaces for AdCP 3.2 proposal negotiation.
AdcpServerBuilder.proposalHandler(...)registration with capability/preflight checks and an explicit atomic finalize transaction callback; response validation occurs before commitadcp-testingfixtures/assertions and boundary/atomicity testsTest plan
./gradlew build --no-configuration-cache(all eight modules)Closes #36