Skip to content

Comments

Feature/negotiate proof proposal#481

Open
rmlearney-digicatapult wants to merge 3 commits intofix/ipfs-stabilityfrom
feature/negotiate-proof-proposal
Open

Feature/negotiate proof proposal#481
rmlearney-digicatapult wants to merge 3 commits intofix/ipfs-stabilityfrom
feature/negotiate-proof-proposal

Conversation

@rmlearney-digicatapult
Copy link
Contributor

@rmlearney-digicatapult rmlearney-digicatapult commented Feb 18, 2026

Pull Request

Checklist

  • Have you read Digital Catapult's Code of Conduct?
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

PR Type

Please delete options that are irrelevant.

  • Feature

Linked tickets

https://digicatapult.atlassian.net/browse/VR-555

High level description

New POST /v1/proofs/{proofRecordId}/negotiate-proposal endpoint for negotiating proofs during proof exchange (supports Anoncreds and PEX) and tests

Detailed description

Added new endpoint logic, unit test, integration test (Anoncreds + PEX)

Deactivate automatic proof acceptance in docker-compose-testnet and add manual acceptance step into affected test suites (e2e.didKey_w3c.test.ts, e2e.onboardingAndVerification.test.ts)

Updated documentation

Describe alternatives you've considered

Operational impact

Enables verifier to insist on restrictions (e.g. your proof must contain issuer ID) after being presented with a proof-proposal message

Additional context

Requires #484 to be merged first

Copilot AI review requested due to automatic review settings February 18, 2026 10:02
@rmlearney-digicatapult rmlearney-digicatapult requested a review from a team as a code owner February 18, 2026 10:02
@rmlearney-digicatapult rmlearney-digicatapult added the v:patch Change requires a semver patch version change label Feb 18, 2026
@rmlearney-digicatapult rmlearney-digicatapult changed the base branch from main to chore/extract-test-helpers February 18, 2026 10:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds proof negotiation capability to the Veritable CloudAgent by introducing a new POST /v1/proofs/{proofRecordId}/negotiate-proposal endpoint. This enables a Verifier to counter-propose modified proof requests in response to Holder-initiated proof proposals, supporting both AnonCreds and Presentation Exchange (PEX) formats. The PR also includes comprehensive test refactoring that extracts common integration test helpers and fixtures into a centralized utilities module (from PR #480).

Changes:

  • New negotiate-proposal endpoint allows Verifiers to modify and send counter-requests based on Holder proposals
  • Integration test helpers extracted to reusable utilities for connection, credential, and proof state polling
  • Docker testnet configuration updated to require manual proof acceptance (AUTO_ACCEPT_PROOFS=never) for more realistic testing
  • Documentation enhanced with proof negotiation workflow examples

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/controllers/v1/proofs/ProofController.ts Added negotiateProposal endpoint with PEX validation and proof format transformation
src/controllers/types/proof.ts Added NegotiateProofProposalOptions interface defining the API contract
tests/unit/proof.test.ts Added unit tests for negotiate-proposal covering AnonCreds restriction transformation and PEX validation
tests/integration/e2e.negotiateProposal.test.ts New comprehensive integration tests for both AnonCreds and PEX negotiation flows
tests/integration/utils/helpers.ts Extracted reusable polling helpers (waitForConnectionByOob, waitForCredentialRecord, waitForProofState, etc.)
tests/integration/utils/fixtures.ts Centralized test configuration constants (base URLs, DIDs, invitation payloads)
tests/integration/e2e.onboardingAndVerification.test.ts Refactored to use centralized fixtures and helper functions, reducing code duplication
tests/integration/e2e.didKey_w3c.test.ts Refactored to use test helpers and added explicit accept-presentation calls
tests/integration/e2e.didWeb_w3c.test.ts Refactored to use test helpers for cleaner async state waiting
tests/integration/e2e.media-sharing.test.ts Refactored to use fixtures and waitForConnectionByOob helper
tests/integration/e2e.media-sharing.events.test.ts Refactored to use fixtures and sleep helper
tests/integration/e2e.makeAuthorisation.test.ts Refactored to import ISSUER_DID_KEY from fixtures
tests/integration/e2e.didwebServer.test.ts Refactored to import DID constants from fixtures
docs/credentials-and-proofs.md Added detailed proof negotiation section with workflow examples for both Holder proposals and Verifier negotiation
docker-compose-testnet.yml Changed AUTO_ACCEPT_PROOFS from always/contentApproved to never to enable manual proof flow testing
package.json Version bump to 0.18.1
package-lock.json Updated lockfile to reflect version change

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 89.45%
⬆️ +0.07%
8553 / 9561
🔵 Statements 89.45%
⬆️ +0.07%
8553 / 9561
🔵 Functions 82.53%
⬆️ +0.16%
260 / 315
🔵 Branches 66.33%
⬆️ +0.13%
536 / 808
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/controllers/v1/proofs/ProofController.ts 93.68%
⬇️ -0.96%
64.51%
⬇️ -2.53%
100%
🟰 ±0%
93.68%
⬇️ -0.96%
117-118, 150-151, 179-180, 200-201, 218-220, 233-234, 269-270, 295-297, 308-312, 330-332, 378-379, 423-426, 441-443, 506-507
Affected Files
src/agent.ts 92.85%
⬆️ +0.11%
75%
🟰 ±0%
100%
🟰 ±0%
92.85%
⬆️ +0.11%
164-181
src/ipfs/index.ts 98.24%
⬇️ -1.76%
95.45%
⬇️ -4.55%
100%
🟰 ±0%
98.24%
⬇️ -1.76%
75-76
src/routes/routes.ts 95.5%
⬆️ +0.06%
41.53%
⬆️ +0.70%
96.77%
⬆️ +0.05%
95.5%
⬆️ +0.06%
1402-1403, 1438-1439, 1454-1479, 1492-1517, 1551-1552, 1588-1589, 1625-1626, 1661-1662, 1697-1698, 1733-1734, 1843-1844, 1952-1953, 1987-1988, 2023-2024, 2059-2060, 2095-2096, 2131-2132, 2167-2168, 2203-2204, 2239-2240, 2276-2277, 2312-2313, 2348-2349, 2386-2387, 2423-2424, 2460-2461, 2496-2497, 2532-2533, 2568-2569, 2595-2596, 2607-2608, 2631-2632, 2643-2644, 2667-2668, 2717-2718, 2753-2754, 2826-2827, 2862-2863, 2898-2899, 2934-2935, 2970-2971, 3007-3008, 3043-3044, 3079-3080, 3116-3117, 3153-3154, 3189-3190, 3226-3227, 3264-3265, 3305-3306, 3341-3342, 3378-3379, 3414-3415, 3450-3451, 3521-3522, 3558-3559, 3593-3594
Unchanged Files
src/error.ts 88.6% 86.66% 87.5% 88.6% 44-45, 67-70, 77-79
src/ioc.ts 100% 100% 100% 100%
src/server.ts 95.18% 66.66% 100% 95.18% 69-70, 75-76
src/anoncreds/index.ts 94.6% 100% 60% 94.6% 160-163, 166-167, 171-175, 178-179
src/controllers/HealthController.ts 100% 66.66% 100% 100%
src/controllers/examples.ts 100% 100% 100% 100%
src/controllers/v1/agent/AgentController.ts 100% 75% 100% 100%
src/controllers/v1/basic-messages/BasicMessageController.ts 96.61% 75% 100% 96.61% 56-57
src/controllers/v1/connections/ConnectionController.ts 93.6% 69.23% 100% 93.6% 85-86, 100-108, 196-197, 223-224, 263-264
src/controllers/v1/credentials/CredentialController.ts 91.53% 48.93% 100% 91.53% 106-107, 133-134, 154-155, 177-181, 212-213, 250-251, 257-263, 295-296, 328-329, 353-354, 384-388
src/controllers/v1/credentials/CredentialDefinitionController.ts 93.5% 63.15% 100% 93.5% 87-88, 123-124, 126-127, 142-145
src/controllers/v1/credentials/SchemaController.ts 95.65% 66.66% 100% 95.65% 82-83, 124-125, 128-129
src/controllers/v1/did/DidController.ts 94.89% 70.83% 100% 94.89% 62-63, 104-106, 114-115
src/controllers/v1/drpc/DrpcController.ts 100% 81.81% 100% 100%
src/controllers/v1/media/MediaController.ts 100% 80% 100% 100%
src/controllers/v1/outofband/OutOfBandController.ts 96.59% 60% 100% 96.59% 192-196, 328-329, 346-350
src/controllers/v1/verified-drpc/VerifiedDrpcController.ts 42.45% 0% 0% 42.45% 28-30, 40-86, 95-105
src/controllers/v1/wallet/WalletController.ts 96.29% 66.66% 100% 96.29% 43-44
src/didweb/error.ts 38.23% 0% 0% 38.23% 5, 8-12, 17-18, 22-34
src/didweb/server.ts 61.4% 100% 62.5% 61.4% 45-46, 65-69, 77-113
src/drpc-handler/index.ts 79.31% 81.25% 66.66% 79.31% 13-14, 45-52, 70-71, 75-77, 80-82
src/events/BasicMessageEvents.ts 100% 100% 100% 100%
src/events/ConnectionEvents.ts 100% 100% 100% 100%
src/events/CredentialEvents.ts 100% 100% 100% 100%
src/events/DrpcEvents.ts 43.58% 100% 50% 43.58% 15-36
src/events/MediaSharingEvents.ts 32.35% 50% 100% 32.35% 10-30, 32-33
src/events/ProofEvents.ts 100% 100% 100% 100%
src/events/TrustPingEvents.ts 43.24% 100% 50% 43.24% 14-34
src/events/VerifiedDrpcEvents.ts 43.58% 100% 50% 43.58% 15-36
src/events/WebSocketEvents.ts 100% 66.66% 100% 100%
src/events/WebhookEvent.ts 73.33% 50% 100% 73.33% 11-14
src/ipfs/responseParser.ts 100% 100% 100% 100%
src/modules/verified-drpc/VerifiedDrpcApi.ts 44.93% 100% 40% 44.93% 62-82, 91-115, 132-145, 156-200, 209-228, 231-241
src/modules/verified-drpc/VerifiedDrpcModule.ts 100% 100% 100% 100%
src/modules/verified-drpc/VerifiedDrpcModuleConfig.ts 100% 100% 100% 100%
src/modules/verified-drpc/VerifiedDrpcRequestEvents.ts 100% 100% 100% 100%
src/modules/verified-drpc/VerifiedDrpcResponseEvents.ts 100% 100% 100% 100%
src/modules/verified-drpc/index.ts 100% 100% 100% 100%
src/modules/verified-drpc/handlers/VerifiedDrpcRequestHandler.ts 88.23% 100% 66.66% 88.23% 15-16
src/modules/verified-drpc/handlers/VerifiedDrpcResponseHandler.ts 88.23% 100% 66.66% 88.23% 15-16
src/modules/verified-drpc/handlers/index.ts 100% 100% 100% 100%
src/modules/verified-drpc/messages/VerifiedDrpcRequestMessage.ts 100% 100% 100% 100%
src/modules/verified-drpc/messages/VerifiedDrpcResponseMessage.ts 75.55% 50% 33.33% 75.55% 29-35, 41-44
src/modules/verified-drpc/messages/index.ts 100% 100% 100% 100%
src/modules/verified-drpc/models/ValidRequest.ts 62.79% 75% 66.66% 62.79% 12-25, 40-41
src/modules/verified-drpc/models/ValidResponse.ts 38.8% 100% 25% 38.8% 12-25, 39-62, 65-67
src/modules/verified-drpc/models/VerifiedDrpcErrorCodes.ts 100% 100% 100% 100%
src/modules/verified-drpc/models/VerifiedDrpcRole.ts 100% 100% 100% 100%
src/modules/verified-drpc/models/VerifiedDrpcState.ts 100% 100% 100% 100%
src/modules/verified-drpc/models/index.ts 100% 100% 100% 100%
src/modules/verified-drpc/repository/VerifiedDrpcRecord.ts 72.5% 100% 50% 72.5% 54-59, 62-65, 68-79
src/modules/verified-drpc/repository/VerifiedDrpcRepository.ts 100% 100% 100% 100%
src/modules/verified-drpc/repository/index.ts 100% 100% 100% 100%
src/modules/verified-drpc/services/VerifiedDrpcService.ts 73.7% 85.18% 65% 73.7% 138-152, 161-167, 171-172, 176-193, 196-214, 225-226, 252-253, 262-265, 267-271, 297-298, 301-302, 305-307
src/modules/verified-drpc/services/index.ts 100% 100% 100% 100%
src/utils/credentials.ts 100% 66.66% 100% 100%
src/utils/didWebGenerator.ts 63.93% 100% 60% 63.93% 73-111, 117-121
src/utils/helpers.ts 85% 100% 50% 85% 18-20
src/utils/logger.ts 91.59% 100% 75% 91.59% 57-59, 68-69, 92-93, 105-107
src/utils/proofs.ts 83.29% 71.26% 93.75% 83.29% 39-41, 44-46, 53-59, 61-62, 67-68, 72-74, 80-98, 105-106, 119-120, 145-146, 161-163, 193-198, 246-247, 250-251, 274-277, 285-288, 313-314
src/utils/version.ts 100% 100% 100% 100%
src/utils/webhook.ts 95.74% 88.88% 100% 95.74% 21-22
Generated in workflow #2817 for commit 9eb7fa4 by the Vitest Coverage Report Action

Base automatically changed from chore/extract-test-helpers to main February 18, 2026 11:22
@rmlearney-digicatapult rmlearney-digicatapult marked this pull request as draft February 18, 2026 12:20
@rmlearney-digicatapult rmlearney-digicatapult marked this pull request as ready for review February 18, 2026 16:15
@rmlearney-digicatapult rmlearney-digicatapult marked this pull request as draft February 19, 2026 10:11
@rmlearney-digicatapult rmlearney-digicatapult marked this pull request as draft February 19, 2026 10:11
@rmlearney-digicatapult rmlearney-digicatapult force-pushed the feature/negotiate-proof-proposal branch from a583b7c to 2f1cd49 Compare February 23, 2026 13:13
@rmlearney-digicatapult rmlearney-digicatapult changed the base branch from main to fix/ipfs-stability February 23, 2026 13:14
@rmlearney-digicatapult rmlearney-digicatapult force-pushed the feature/negotiate-proof-proposal branch from 2f1cd49 to 48198a5 Compare February 23, 2026 13:16
@rmlearney-digicatapult rmlearney-digicatapult force-pushed the feature/negotiate-proof-proposal branch from 48198a5 to 9eb7fa4 Compare February 23, 2026 13:17
@rmlearney-digicatapult rmlearney-digicatapult marked this pull request as ready for review February 23, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v:patch Change requires a semver patch version change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant