You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,13 +41,13 @@ When making changes, always update documentation files before modifying code.
41
41
42
42
### Non-Negotiable Rules
43
43
- 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.
45
45
- You MUST NOT add ad-hoc "temporary logging"; only the defined JUL levels above are acceptable.
46
46
- You SHOULD NOT delete logging. Adjust levels downward (finer granularity) instead of removing statements.
47
47
- You MUST add a JUL log statement at INFO level at the top of every test method announcing execution.
48
48
- 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)`.
49
49
- 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.
51
51
- YOU MUST honour official JUL logging levels:
52
52
- SEVERE (1000): Critical errors—application will likely abort.
53
53
- WARNING (900): Indications of potential problems or recoverable issues.
@@ -59,7 +59,8 @@ When making changes, always update documentation files before modifying code.
59
59
60
60
### Run Tests With Valid Logging
61
61
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.
63
64
- You MUST pass in a `java.util.logging.ConsoleHandler.level` of INFO or more low-level.
64
65
- 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
65
66
- You SHOULD run a single test class using `-Dtest=BlahTest -Djava.util.logging.ConsoleHandler.level=FINE` as fine will show you basic debug info
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.
85
86
86
87
### Output Visibility Requirements
87
88
88
89
- 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
89
90
- You MAY log full data structures at FINEST for deep tracing. Run a single test method at that granularity.
90
91
- 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.
92
93
- 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.
93
94
94
95
### Logging Practices
95
96
- 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:
96
97
97
98
```java
98
-
LOG.severe(() ->"ERROR: Remote references disabled but computeIfAbsent called for: "+key);
99
+
LOG.severe(() ->"ERROR: "+message);
99
100
```
100
101
101
102
- Only tag true errors (pre-exception logging, validation failures, and similar) with the `ERROR` prefix. Do not downgrade log semantics.
0 commit comments