Datasets:
Download LABELING.md from alejandrosalastexido/ModuleMap-Bench: direct link, hf CLI and curl.
- Browser
- Download file 14.5 kB
-
https://huggingface.co/datasets/alejandrosalastexido/ModuleMap-Bench/resolve/main/LABELING.md
- Command line
-
hf download hf://datasets/alejandrosalastexido/ModuleMap-Bench/LABELING.md
-
curl -L -o LABELING.md https://huggingface.co/datasets/alejandrosalastexido/ModuleMap-Bench/resolve/main/LABELING.md
Labelling guide — ModuleMap-Bench
Version 2.1 (2026-11-13). Supersedes ANNOTATION_GUIDELINES.md 1.1; every
rule of 1.1 is kept, reordered, and marks are now labelled. A label records
guideline_version; a change to this file that can change a label raises the
version.
1. Unit and sources
One top-level Java type (class, abstract class, interface, enum, record,
annotation type) in a module's src/main/java, at the project's pinned commit.
Nested types belong to their outer type. Test code is out of scope.
Decide from the source code: the type's file first; then, when a rule below
asks for it, its supertypes, implementations, subclasses, users and the
module's pom.xml. Never read the output of a tool that assigns roles or
marks — agentkit's Maps, AGENTS.md, .agentkit/, --dump-features, its JSON
traces — and never run one.
Each label has: one role, a list of marks (possibly empty), a
confidence (sure or unsure) and a one-sentence rationale that cites
the line of code it rests on (L12: @FeignClient(name = "pay-server")).
2. Decision order
Take the first step that decides; rule numbers refer to section 4.
- Always
none(section 3.8) — exceptions, enums, constants, annotation types, builders and factories, validators, DTOs/VOs/forms, converters,package-info. Stop. A utility isnoneonly when no step below describes what it does: a*Utilwhose main job is a remote call is aclient(rule 4.1, what it does beats its name). - Invoked by a framework as the start of a unit of work →
entry(rule 4.2 lets it beat any role below). - Is persisted data →
domain(beatsevent, rule 4.3). - Reads or writes the application's own store →
persistence. - Calls another system over the network as its main purpose →
client(HTTP, but also SSH/SCP/SFTP, an LDAP or mail server, a broker connection the class opens itself; section 3.2). - Is an event (a message saying something happened) →
event. - Configures the application →
config. - Holds business logic →
service. - Interface or abstract class: take the role its implementations or
subclasses agree on (rules 4.4, 4.5); with none,
none. - Otherwise
none.
Then decide the marks (section 5) independently of the role.
3. Roles
3.1 entry — invoked by a framework as the start of a unit of work
Examples:
OrderControllerwith@RestControllerand@GetMapping("/orders/{id}").PaymentListenerwith@KafkaListener(topics = "payments"), or a@RocketMQMessageListener,@RabbitListener, Redis Stream listener.ApprovalDelegate implements JavaDelegate(BPMN service task), anExecutionListener/TaskListener, an external-task handler or Camunda 8 job worker.CleanupJobwith@Scheduled(cron = …), a QuartzJob, an xxl-job handler.- The
@SpringBootApplicationclass; aCommandLineRunner/ApplicationRunner; aSpringBootServletInitializer; a JAX-RS@Pathresource; a gRPC service implementation, servlet, WebSocket endpoint, GraphQL resolver. - A class whose main method is an
@EventListeneror that implementsApplicationListener, or subscribes to a domain-event bus.
Counter-examples:
GlobalExceptionHandlerwith@RestControllerAdvice→none(it handles errors of a unit of work, it does not start one).- A servlet filter,
HandlerInterceptoror gateway filter →none. - A
@Controllerwith no request mapping → by its other evidence, usuallynone. - An LLM tool callback or a parse-time hook →
none.
3.2 client — calls another system over the network
Examples:
PayApiwith@FeignClient(name = "pay-server").- An interface with
@HttpExchangemethods (Spring HTTP interface). SmsSender, a class whose main job is calling a remote HTTP API through aRestTemplate,WebClientorOkHttpClientfield.NacosRulePublisher, a reader or writer of a remote configuration store.SftpFileClient,ScpClientUtil,ExecuteShellUtil: a class that opens a connection to another host itself (SFTP, SCP, SSH) to do its work.KafkaAdaptercreating aKafkaConsumerand polling it in its own loop, or an MQTT client it connects and subscribes itself: the class drives the remote call, no framework invokes it (a@KafkaListenerwould beentry).
Counter-examples:
PayApiFallbackFactory→none(fallback, not the call).- A class that wraps an in-process engine (
RuntimeServiceof an embedded Camunda) →serviceornone, notclient. - A storage adapter writing to the application's own database →
persistence.
3.3 service — holds business logic
Business logic means decisions about the application's own business data
(orders, users, configurations of the product): what to create, change,
allow or refuse. Technical machinery — parsing, resolving, caching,
decorating, validating input, mapping errors, cross-cutting aspects — is
none even when it is a @Component and its methods contain conditions.
Examples:
OrderServiceImplwith@Serviceand business methods.OrderService, an interface implemented by a@Service(rule 4.5).- A use case, application service, command or query handler (
CourseCreator,SendMoneyService); a stateless domain service (CourseFinder). - A message publisher that decides what to publish.
- In infrastructure products: a class doing the product's own work on request
(
*Cmdof an engine, the core manager of a server). - A class annotated
@Service(or@DubboService, a service-framework bean) isserviceeven when it only delegates to its mapper or repository: the mapper, DAO or repository holding the queries ispersistence, the@Serviceover it is the service layer (LitemallOrderService).
Counter-examples:
- A thin adapter around a framework (
RedisTemplatewrapper with no rules) →none. DateUtils,JsonHelper→none.@Aspectreleasing a lock, aPermissionValidator, a text-to-change-set resolver, a caching decorator, a failure-to-exception resolver →none(technical machinery, even with conditions inside).- A strategy interface whose implementations generate codes or numbers
(
IFillRuleHandler) →noneunless the implementations decide on business data; an@Serviceimplementation of it would make itservice(rule 4.5).
3.4 domain — persisted business data
Examples:
UserDOwith@TableName("system_users")(MyBatis-Plus); a JPA@Entity,@Embeddable,@MappedSuperclassor base entity; a Mongo@Document.LitemallGoods, a plain class a MyBatis mapper XML or generator maps to a table.- A value object stored as a field or column of a stored aggregate (
CourseId,Moneyof a stored account,TrackingIdkept astracking_id,PatronHoldsof a storedPatron). Look at who holds it (the users listed beside the code): when a stored aggregate keeps it, it isdomain, even without any mapping annotation on the value object itself. - A record stored in a configuration or rule store.
- A persisted notification, even when named
*Event(rule 4.3).
Counter-examples:
UserRespVO,OrderCreateReqDTO, a page or projection object →none, even when it mirrors the entity field for field.- A criteria or specification object that is not stored →
none.
3.5 persistence — reads or writes the application's own store
Examples:
UserMapper extends BaseMapperX<UserDO>(MyBatis/MyBatis-Plus).OrderRepository extends JpaRepository<Order, Long>; a DAO.CourseRepository, a domain repository interface, andMySqlCourseRepository, its implementation (any store, also in memory).- In infrastructure products: a
*Manageror*Daoover the product's own tables.
Counter-examples:
GoodsExample, a generator criteria class →none.UserConvert(MapStruct "mapper") or an Excel mapper →none.
3.6 event — is an event, not its handler
Examples:
OrderPaidEvent extends ApplicationEvent.CourseCreatedDomainEventpublished on a domain-event bus.KafkaPaymentDto, a plain object published to a broker as the message that something happened, whatever its name.
Counter-examples:
OrderPaidListenerhandling the event →entry.- A persisted
Notificationrecord →domain.
3.7 config — configures the application
Examples:
RedisConfigwith@Configurationand@Beanmethods.PayAutoConfigurationwith@AutoConfiguration.SmsPropertieswith@ConfigurationProperties(prefix = "sms").
Counter-examples:
- A
@Componentthat validates settings or customises error output →none. UploadConfig, a plain value class named*Config→none.- A
@Configurationwhose main method is an@EventListener→entry(rule 4.2).
3.8 none — none of the above
Examples: DTOs, VOs, forms, requests, responses; enums and constants in any package; exceptions; annotation types; utilities; builders and factories; validators; converters and assemblers; interceptors and filters; framework SPI adapters; the plumbing of a bus (the bus, its registry, serializer, middleware); command and query messages; parsers, caches and internal data structures of an infrastructure product; test fixtures shipped in main code.
Counter-examples:
- An enum stored as a table → still
none(enums are alwaysnone). - A
*Helperthat runs business rules →service(rule 4.1).
4. When two roles seem to apply
- What it does at run time beats what it is called.
KongAdapterServicecalling the Kong admin API is aclient;JobRegistryHelperrunning registry logic on its own thread is aservice. - Being invoked by the framework wins. A
@Serviceor@Configurationwhose main method is an@EventListeneris anentry. - Persisted data beats event. A stored notification is
domain. - An abstract base takes the role of its subclasses when they are all one
thing (an abstract stream listener is an
entry). - An interface takes the role of its implementations when they agree; an
input port implemented by a service is a
service, an output port implemented by a persistence adapter ispersistence; with no implementation and no other evidence,none. - Still undecided: choose the closer role, mark the label
unsure, and name the runner-up in the rationale.
5. Marks
Marks say who relies on the type, not what it does; they are decided
separately and may sit beside any role, none included.
5.1 api — part of its module's contract with the other modules
The type is public and the main code of another module of the same reactor
imports or uses it (test code and modules outside the reactor do not count),
and it is not in an internal or impl package.
Examples:
PayApi(client) inpay-api, imported byorder-server:client+api.RedisService(service) inmall-common, imported bymall-admin:service+api.ApiErrorLogCreateReqDTO(none) imported by three modules:none+api.
Counter-examples:
- A type imported only by another module's tests → no
api. - A public class in
…internal…imported by another module → noapi(it leaks, it is not a contract); say so in the rationale.
5.2 ext — an extension point
An interface or abstract class with two or more implementations or subclasses in the reactor, meant to be implemented.
Examples:
PayClient, an interface withAlipayPayClientandWxPayClient.AbstractStreamListenerwith several concrete listeners (entry+ext).- A strategy interface with one implementation per channel.
Counter-examples:
- A service interface with a single
*Impl→ noext. - An interface implemented only by framework proxies or by code outside the
reactor → no
ext.
6. Cases that come up often
| Case | Label |
|---|---|
Service interface without annotation, whose single implementation is @Service |
service (4.5); api if another module imports the interface; no ext |
| Feign client imported by another module | client + api |
Class wrapping RestTemplate/WebClient to call a remote API |
client; if it only builds the template bean → config |
Data class in a model package that is not stored (no mapping, no repository saves it) |
none; check mapper XML and repositories first (step 3 of 2) |
BPMN delegate (JavaDelegate), execution/task listener |
entry |
Scheduled job (@Scheduled, Quartz, xxl-job) |
entry |
Event listener (@EventListener, ApplicationListener, broker listener) |
entry |
| Event payload published to a broker | event |
@ControllerAdvice, filters, interceptors |
none |
| Enum, exception, constant class, utility | none |
Generated *Example, *Column enum |
none |
When is it none? When no role of section 3 describes what the type does
when the application runs — it carries data that is not stored, converts,
validates, helps, or is plumbing. none is a label, not a failure to decide:
mark it unsure only when a real role was close.
7. Confidence and rationale
sure: the cited line settles it under the rules above.unsure: a rule of section 4 was needed and the evidence was thin, two roles were close, or a file the decision needed could not be read.- The rationale is one sentence, cites a line (
L<n>: …) of the type's file or names the other file read, and names the runner-up when there is one.
8. Changes
2.1 (2026-11-13), from the second-annotator pass over the 1145 dev types (κ 0.936; lowest: client 0.80, service 0.88): business logic defined and technical machinery made
none(3.3); a@Serviceover a mapper staysservice; non-HTTP remote connections opened by the class areclient(3.2); a utility's name never beats what it does (step 1); a value object kept by a stored aggregate isdomain— look at who holds it (3.4).2.0 (2026-11-13): marks labelled (section 5); confidence; rationale cites a line; examples and counter-examples per role; decision order made explicit. Role rules unchanged from 1.1.
1.1 (2026-11-10/11): domain-driven, entry points beyond Spring MVC, data without annotations, infrastructure products (
ANNOTATION_GUIDELINES.md§6).1.0 (2026-11-08): roles only.