|
Download ANNOTATION_GUIDELINES.md from alejandrosalastexido/ModuleMap-Bench: direct link, hf CLI and curl.
- Browser
- Download file 5.12 kB
-
https://huggingface.co/datasets/alejandrosalastexido/ModuleMap-Bench/resolve/main/ANNOTATION_GUIDELINES.md
- Command line
-
hf download hf://datasets/alejandrosalastexido/ModuleMap-Bench/ANNOTATION_GUIDELINES.md
-
curl -L -o ANNOTATION_GUIDELINES.md https://huggingface.co/datasets/alejandrosalastexido/ModuleMap-Bench/resolve/main/ANNOTATION_GUIDELINES.md
5.12 kB
| # Annotation guidelines | |
| These are the rules the role labels of ModuleMap-Bench follow. A second annotator | |
| uses them unchanged (see `annotation/README.md`). | |
| ## 1. Unit | |
| One **top-level Java type** — class, abstract class, interface, enum, record or | |
| annotation — declared in a Maven module’s `src/main/java`, at the commit given | |
| for its project. Nested types belong to their outer type. Test code is out of | |
| scope. | |
| ## 2. What to decide | |
| Exactly **one role**: what the type *does* when the application runs. Choose | |
| from the eight values below. Decide from the source file at the given commit; | |
| you may open other files of the repository (its supertypes, its users, the | |
| `pom.xml`). **Never look at the output of a tool** that assigns roles, | |
| agentkit included. | |
| Write a short **note** whenever the decision is not obvious, and name the | |
| runner-up when there is one (“could be read as persistence”). | |
| Who *uses* a type — another module importing it, two classes implementing it — | |
| is **not** labelled: it is a structural fact, computed and published beside | |
| the label (`structure.imported_by`, `structure.implementations`, | |
| `structure.derived_marks`). | |
| ## 3. Roles | |
| | Role | The type… | Typical forms | Not this role | | |
| |---|---|---|---| | |
| | `entry` | is invoked by a framework as the **start of a unit of work** from outside the application code | `@RestController`/`@Controller` with at least one request mapping; message listeners (`@KafkaListener`, `@RabbitListener`, `@JmsListener`, RocketMQ, Redis Stream); scheduled jobs (`@Scheduled`, Quartz/xxl-job handlers); `@EventListener`, `ApplicationListener`; workflow delegates and listeners (`JavaDelegate`, `ExecutionListener`, `TaskListener`, external-task handlers, Camunda 8 job workers); the `@SpringBootApplication` class | `@ControllerAdvice`/`@RestControllerAdvice` exception handlers; servlet and gateway filters, interceptors; parse-time hooks; a controller with no mapping; LLM tool callbacks | | |
| | `client` | **calls another system** over the network | Feign clients, Spring HTTP interfaces (`@HttpExchange`); a class whose main purpose is calling a remote HTTP API (`RestTemplate`, `WebClient`, `OkHttpClient`); readers/writers of a remote configuration store | Feign fallbacks and fallback factories; clients of an in-process engine; storage adapters that write to the application’s own database (→ `persistence`) | | |
| | `service` | holds **business logic** | `@Service` classes; service interfaces and facades (`*Service`, `*Api`) implemented by a service; components doing business work; message publishers | thin framework adapters (→ `none`); utilities (→ `none`) | | |
| | `domain` | is **persisted business data** | JPA entities, `@Embeddable`, `@MappedSuperclass` and base entities; MyBatis-Plus `@TableName` classes; Mongo `@Document`s; records stored in a configuration or rule store | DTOs, VOs, request and response objects, non-persisted aggregates (→ `none`) | | |
| | `persistence` | **reads or writes the application’s data store** | Spring Data repositories, MyBatis mappers, DAOs, classes upserting records | generator `*Example` criteria classes (→ `none`); Excel or object “mappers” that are converters (→ `none`) | | |
| | `event` | **is an event**, not a handler | classes extending `ApplicationEvent`; event payload classes (`*Event`) that are not persisted | persisted notifications (→ `domain`) | | |
| | `config` | **configures** the application | `@Configuration`, `@AutoConfiguration`, `@ConfigurationProperties` | `@Component`s that validate settings or customise error output (→ `none`); plain value classes named `*Config` (→ `none`) | | |
| | `none` | none of the above | DTOs, enums, constants, utilities, exceptions, annotations, interceptors and filters, framework SPI adapters, test bases shipped in main code | | | |
| ## 4. When two roles seem to apply | |
| 1. **What it does at run time wins over what it is called.** A `KongAdapterService` | |
| that calls the Kong admin API is a `client`; a `JobRegistryHelper` running | |
| registry logic on its own thread is a `service`. | |
| 2. **Being invoked by the framework wins.** A `@Service` or a `@Configuration` | |
| whose main method is an `@EventListener` is an `entry`. | |
| 3. **Persisted data wins over event.** A stored notification is `domain`. | |
| 4. **An abstract base takes the role of what its subclasses are**, when all of | |
| them are one thing (an abstract stream listener is an `entry`). | |
| 5. **An interface takes the role of its implementations** when they agree | |
| (a service interface is a `service`), and is `none` when it has no | |
| implementation and no other evidence. | |
| 6. Still undecided: pick the closer role and say so in the note. | |
| ## 5. Quality | |
| - Each project’s types were sampled from its files only (stratified by the last | |
| word of the type name), so the labels do not depend on any tool. | |
| - Round 1: one pass by an LLM coding assistant following these rules, 2026-11-08, | |
| all 620 labels; notes record every non-obvious decision. | |
| - Round 2: an independent annotator labels a blinded sample of 150 | |
| (`annotation/round-2/sample.csv`); agreement is reported as Cohen’s κ. | |