@@ -6621,6 +6621,14 @@ function testMemoryArtifactLinkProjectionAndWriterIntegration() {
66216621 targetPath : 'reports/Report One.md' ,
66226622 purpose : 'dedupe probe'
66236623 }
6624+ const unverifiedCapability = createLinkCapabilityDecision ( {
6625+ surface : 'unverified-memory-mcp-test' ,
6626+ evidenceState : 'unverified' ,
6627+ supportsMarkdown : true ,
6628+ workspaceRoot : activeRoot ,
6629+ targetRelation : 'workspace'
6630+ } )
6631+ assert . strictEqual ( unverifiedCapability . validation . valid , true )
66246632 const projected = runServer ( 'mcp/memory-server.js' , [
66256633 rpcRequest ( 1 , 'tools/list' ) ,
66266634 rpcRequest ( 2 , 'tools/call' , {
@@ -6631,12 +6639,34 @@ function testMemoryArtifactLinkProjectionAndWriterIntegration() {
66316639 artifacts : [ reportArtifact , duplicateArtifact ] ,
66326640 linkCapability : capability
66336641 }
6642+ } ) ,
6643+ rpcRequest ( 20 , 'tools/call' , {
6644+ name : 'memory_artifact_link_project' ,
6645+ arguments : {
6646+ documentPath : dailyDocument ,
6647+ artifacts : [ reportArtifact ] ,
6648+ linkCapability : unverifiedCapability
6649+ }
66346650 } )
66356651 ] , projectRoot )
66366652 const listedTools = resultById ( projected , 1 ) . tools
66376653 const projectionSchema = findToolSchema ( listedTools , 'memory_artifact_link_project' )
66386654 assert . deepStrictEqual ( projectionSchema . required , [ 'documentPath' , 'artifacts' , 'linkCapability' ] )
66396655 assert . deepStrictEqual ( projectionSchema . properties . operation . enum , [ 'project' , 'validate-existing' ] )
6656+ const declaredEvidenceStates = projectionSchema . properties . linkCapability . properties . evidenceState . enum
6657+ assert ( declaredEvidenceStates . includes ( unverifiedCapability . evidenceState ) , 'tools/list must accept the producer unverified fallback' )
6658+ for ( const evidenceState of declaredEvidenceStates ) {
6659+ const decision = createLinkCapabilityDecision ( {
6660+ surface : 'declared-memory-mcp-state' , evidenceState, supportsMarkdown : true ,
6661+ workspaceRoot : activeRoot , targetRelation : 'workspace' , evidenceRefs : [ 'test:canonical-containment' ]
6662+ } )
6663+ assert . strictEqual ( decision . validation . valid , true , `tools/list declares an unsupported state: ${ evidenceState } ` )
6664+ }
6665+ const portableProjection = toolJson ( resultById ( projected , 20 ) )
6666+ assert . strictEqual ( portableProjection . capability . evidenceState , 'unverified' )
6667+ assert . strictEqual ( portableProjection . capability . mode , 'portable' )
6668+ assert . strictEqual ( portableProjection . capability . absolutePathFallback , false )
6669+ assert . strictEqual ( portableProjection . links [ 0 ] . markdown , '[Report One](<../../../../reports/Report One.md>)' )
66406670 const projection = toolJson ( resultById ( projected , 2 ) )
66416671 assert . strictEqual ( projection . schemaVersion , 'ArtifactLinkProjectionSetV1' )
66426672 assert . strictEqual ( projection . dedupe . inputCount , 2 )
0 commit comments