Repository navigation
Expand file tree
/
Copy pathpom.xml
More file actions
273 lines (261 loc) · 14 KB
/
Copy pathpom.xml
File metadata and controls
273 lines (261 loc) · 14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.agentclientprotocol</groupId>
<artifactId>acp-java-sdk</artifactId>
<version>0.19.0-SNAPSHOT</version>
</parent>
<artifactId>acp-core</artifactId>
<packaging>jar</packaging>
<name>ACP Core</name>
<description>Core ACP implementation with stdio transport; needs one JSON module (acp-json-jackson2 or acp-json-jackson3) at runtime</description>
<properties>
<!-- Coverage floors: measured line 92.11% (JDK 17) and 92.17% (JDK 21), branch 80.19% (JDK 17) and 80.66% (JDK 21); the lower of the two less 2 points (parent pom, JaCoCo) -->
<jacoco.minimum.line>0.90</jacoco.minimum.line>
<jacoco.minimum.branch>0.78</jacoco.minimum.branch>
<!-- JaCoCo's prepare-agent sets argLine; empty when JaCoCo is skipped. -->
<argLine/>
</properties>
<dependencies>
<!-- JSpecify null-marking annotations (@NullMarked packages, @Nullable) -->
<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
</dependency>
<!-- ACP annotations (@UnstableAcpApi, etc.) - zero-dependency module -->
<dependency>
<groupId>com.agentclientprotocol</groupId>
<artifactId>acp-annotations</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Reactor for async operations -->
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
<!-- Jackson annotations on the schema records. Only the annotations: the JSON
implementation comes from acp-json-jackson2 or acp-json-jackson3, both of
which read this annotation package. -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.lincheck</groupId>
<artifactId>lincheck</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
<!-- acp-core's own tests need a mapper, but cannot depend on acp-json-jackson2
(it depends on acp-core). They use the small test-only Jackson 2 mapper in
src/test (TestJacksonAcpJsonMapperSupplier). -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
<!-- LICENSE and NOTICE for the test-jar, like every other artifact -->
<testResource>
<directory>${maven.multiModuleProjectDirectory}</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</testResource>
</testResources>
<plugins>
<!-- Lincheck (the *LincheckTest classes) attaches its instrumentation agent at
runtime. JDK 21+ warns about a dynamically loaded agent unless
EnableDynamicAgentLoading is set; JDK 17 does not know the flag, hence
IgnoreUnrecognizedVMOptions. @{argLine} keeps JaCoCo's agent. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine} -XX:+IgnoreUnrecognizedVMOptions -XX:+EnableDynamicAgentLoading</argLine>
</configuration>
</plugin>
<!-- The JSON contract suite: the schema serialization tests that every JSON
module runs against its own mapper (surefire dependenciesToScan). They
obtain their mapper from AcpJsonMapper.createDefault(), so the test-only
supplier and its services file are left out. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>json-contract-test-jar</id>
<goals>
<goal>test-jar</goal>
</goals>
<configuration>
<includes>
<include>com/agentclientprotocol/sdk/AcpTestFixtures*.class</include>
<include>com/agentclientprotocol/sdk/json/AcpJsonMapperContractTest*.class</include>
<include>com/agentclientprotocol/sdk/json/JsonTree*.class</include>
<include>com/agentclientprotocol/sdk/json/StrictMapperFixtures*.class</include>
<include>com/agentclientprotocol/sdk/json/UnknownPropertyPolicyTest*.class</include>
<include>com/agentclientprotocol/sdk/spec/AcpJsonRpcMessageTest*.class</include>
<include>com/agentclientprotocol/sdk/spec/AcpSchemaDiscriminatorTest*.class</include>
<include>com/agentclientprotocol/sdk/spec/AcpSchemaSerializationTest*.class</include>
<include>com/agentclientprotocol/sdk/spec/DefaultOnNullTest*.class</include>
<include>com/agentclientprotocol/sdk/spec/McpServerConfigurationTest*.class</include>
<include>com/agentclientprotocol/sdk/spec/SessionCapabilitiesWireTest*.class</include>
<include>com/agentclientprotocol/sdk/spec/SessionManagementTest*.class</include>
<include>com/agentclientprotocol/sdk/spec/SessionUpdateDeserializationTest*.class</include>
<include>com/agentclientprotocol/sdk/spec/WireFormatTest*.class</include>
<include>com/agentclientprotocol/sdk/test/GoldenFileTest*.class</include>
<include>golden/**</include>
<include>META-INF/LICENSE</include>
<include>META-INF/NOTICE</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!-- Mutation testing pilot (PIT), not part of the default build. Measures how well
the tests catch injected bugs in the protocol core: the two session classes,
the request/response plumbing they share (with the pending-response table and
the single-turn prompt rule), and the json package. AcpSchema
(records: mutated accessors are noise) and logging calls are left out.
Run: ./mvnw -Ppit -pl acp-core -am test
Report: acp-core/target/pit-reports/index.html -->
<profile>
<id>pit</id>
<properties>
<pitest-maven.version>1.30.0</pitest-maven.version>
<pitest-junit5-plugin.version>1.2.3</pitest-junit5-plugin.version>
<!-- -Dpit.mutators=STRONGER for the larger set -->
<pit.mutators>DEFAULTS</pit.mutators>
<!-- -Dpit.threads=8 on a larger machine -->
<pit.threads>4</pit.threads>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>${pitest-maven.version}</version>
<dependencies>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>${pitest-junit5-plugin.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>pit</id>
<phase>test</phase>
<goals>
<goal>mutationCoverage</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- The pilot scored 90% (DEFAULTS) and 88% (STRONGER) once the
gaps it found were tested; every remaining survivor is
equivalent or log-only. The run fails below this. -->
<mutationThreshold>85</mutationThreshold>
<targetClasses>
<param>com.agentclientprotocol.sdk.spec.AcpClientSession*</param>
<param>com.agentclientprotocol.sdk.spec.AcpAgentSession*</param>
<param>com.agentclientprotocol.sdk.spec.OutboundMessages*</param>
<param>com.agentclientprotocol.sdk.spec.PendingResponses*</param>
<param>com.agentclientprotocol.sdk.spec.ActivePrompts*</param>
<param>com.agentclientprotocol.sdk.spec.Prompt*</param>
<param>com.agentclientprotocol.sdk.spec.InboundMessages*</param>
<param>com.agentclientprotocol.sdk.spec.ResponseResults*</param>
<param>com.agentclientprotocol.sdk.spec.AcpError*</param>
<param>com.agentclientprotocol.sdk.json.*</param>
</targetClasses>
<excludedClasses>
<param>com.agentclientprotocol.sdk.spec.AcpSchema*</param>
</excludedClasses>
<targetTests>
<param>com.agentclientprotocol.sdk.*</param>
</targetTests>
<excludedTestClasses>
<!-- Integration tests: a real CLI process and a stdio
subprocess shutdown; slow, and run by failsafe. -->
<param>com.agentclientprotocol.sdk.*IT</param>
<!-- Architecture rules: never kill a mutant, cost a class scan. -->
<param>com.agentclientprotocol.sdk.ArchitectureTest</param>
<param>com.agentclientprotocol.sdk.SchedulerBestPracticesTest</param>
<!-- Lincheck model checking: tens of seconds per class and
its own instrumentation agent; the classes it checks
are covered by their unit tests here. -->
<param>com.agentclientprotocol.sdk.*LincheckTest</param>
</excludedTestClasses>
<avoidCallsTo>
<avoidCallsTo>org.slf4j</avoidCallsTo>
</avoidCallsTo>
<mutators>
<mutator>${pit.mutators}</mutator>
</mutators>
<threads>${pit.threads}</threads>
<!-- The session tests wait on Reactor timeouts; give a
mutant room before calling it TIMED_OUT. -->
<timeoutConstant>8000</timeoutConstant>
<timeoutFactor>2.0</timeoutFactor>
<timestampedReports>false</timestampedReports>
<outputFormats>
<outputFormat>HTML</outputFormat>
<outputFormat>XML</outputFormat>
</outputFormats>
<exportLineCoverage>true</exportLineCoverage>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>