Skip to content

Commit 3d2de89

Browse files
committed
Issue #129 Clarify mvn wrapper policy in AGENTS
1 parent 84bd7b9 commit 3d2de89

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

AGENTS.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ When making changes, always update documentation files before modifying code.
4141

4242
### Non-Negotiable Rules
4343
- You MUST NOT ever filter test output; debugging relies on observing the unknown.
44-
- You MUST restrict the amount of tokens by adding logging at INFO, FINE, FINER, and FINEST. Focus runs on the narrowest model/test/method that exposes the issue.
44+
- You MUST keep debug output actionable by using JUL levels (INFO/FINE/FINER/FINEST) and running the narrowest test/class/module that reproduces the issue.
4545
- You MUST NOT add ad-hoc "temporary logging"; only the defined JUL levels above are acceptable.
4646
- You SHOULD NOT delete logging. Adjust levels downward (finer granularity) instead of removing statements.
4747
- You MUST add a JUL log statement at INFO level at the top of every test method announcing execution.
4848
- You MUST have all new tests extend a helper such as `JsonSchemaLoggingConfig` so environment variables configure JUL levels compatibly with `$(command -v mvnd || command -v mvn || command -v ./mvnw)`.
4949
- You MUST NOT guess root causes; add targeted logging or additional tests. Treat observability as the path to the fix.
50-
- YOU MUST Use exactly one logger for the JSON Schema subsystem and use appropriate logging to debug as below.
50+
- Use a single shared logger per subsystem/package and use appropriate JUL levels to debug.
5151
- YOU MUST honour official JUL logging levels:
5252
- SEVERE (1000): Critical errors—application will likely abort.
5353
- WARNING (900): Indications of potential problems or recoverable issues.
@@ -59,7 +59,8 @@ When making changes, always update documentation files before modifying code.
5959

6060
### Run Tests With Valid Logging
6161

62-
- You MUST prefer the `$(command -v mvnd || command -v mvn || command -v ./mvnw)` wrapper for every Maven invocation.
62+
- For agent/local development, prefer `$(command -v mvnd || command -v mvn || command -v ./mvnw)` to automatically pick the fastest available tool.
63+
- User-facing documentation MUST only use the top-level `./mvnw` command.
6364
- You MUST pass in a `java.util.logging.ConsoleHandler.level` of INFO or more low-level.
6465
- You SHOULD run all tests in all models or a given `-pl mvn_moduue` passing `-Djava.util.logging.ConsoleHandler.level=INFO` to see which tests run and which tests might hang
6566
- You SHOULD run a single test class using `-Dtest=BlahTest -Djava.util.logging.ConsoleHandler.level=FINE` as fine will show you basic debug info
@@ -81,21 +82,21 @@ $(command -v mvnd || command -v mvn || command -v ./mvnw) -Dtest=BlahTest#testSo
8182
$(command -v mvnd || command -v mvn || command -v ./mvnw) -pl json-java21-api-tracker -Dtest=ApiTrackerTest -Djava.util.logging.ConsoleHandler.level=FINE
8283
```
8384

84-
IMPORTANT: Fix the method with FINEST logging, then fix the test class with FINER logging, then fix the module with FINE logging, then run the whole suite with INFO logging. THERE IS NO TRIVIAL LOGIC LEFT IN THIS PROJECT TO BE SYSTEMATIC.
85+
IMPORTANT: Fix the method with FINEST logging, then fix the test class with FINER logging, then fix the module with FINE logging, then run the whole suite with INFO logging.
8586

8687
### Output Visibility Requirements
8788

8889
- You MUST NEVER pipe build or test output to tools (head, tail, grep, etc.) that reduce visibility. Logging uncovers the unexpected; piping hides it. Use the instructions above to zoom in on what you want to see using `-Dtest=BlahTest` and `-Dtest=BlahTest#testSomething` passing the appropriate `Djava.util.logging.ConsoleHandler.level=XXX` to avoid too much outputs
8990
- You MAY log full data structures at FINEST for deep tracing. Run a single test method at that granularity.
9091
- If output volume becomes unbounded (for example, due to inadvertent infinite loops), this is the only time head/tail is allowed. Even then, you MUST inspect a sufficiently large sample (thousands of lines) to capture the real issue and avoid focusing on Maven startup noise.
91-
- My time is far more precious than yours do not error on the side of less information and thrash around guessing. You MUST add more logging and look harder!
92+
- Avoid guessing. Add targeted logging or additional tests until the failing case is fully observable.
9293
- Deep debugging employs the same FINE/FINEST discipline: log data structures at FINEST for one test method at a time and expand coverage with additional logging or tests instead of guessing.
9394

9495
### Logging Practices
9596
- JUL logging is used for safety and performance. Many consumers rely on SLF4J bridges and search for the literal `ERROR`, not `SEVERE`. When logging at `SEVERE`, prefix the message with `ERROR` to keep cloud log filters effective:
9697

9798
```java
98-
LOG.severe(() -> "ERROR: Remote references disabled but computeIfAbsent called for: " + key);
99+
LOG.severe(() -> "ERROR: " + message);
99100
```
100101

101102
- Only tag true errors (pre-exception logging, validation failures, and similar) with the `ERROR` prefix. Do not downgrade log semantics.

0 commit comments

Comments
 (0)