Skip to content

Commit 63fd810

Browse files
author
Mateusz
committed
fix: Update documentation and refactor test code
- Improved documentation clarity in AGENTS.md (debugging section, reporting guidelines) - Added log color CLI parameter documentation - Refactored test assertions to use next() over list comprehension indexing - Removed obsolete reproduce_issue.py test script
1 parent db82c21 commit 63fd810

File tree

4 files changed

+17
-76
lines changed

4 files changed

+17
-76
lines changed

AGENTS.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ When working on specs, the user will invoke `/kiro:*` commands. Follow the instr
6161
| **Test (Full)** | `./.venv/Scripts/python.exe -m pytest -m "integration or unit"` |
6262
| **Lint/Fix** | `./.venv/Scripts/python.exe -m ruff --fix check .` |
6363
| **Format** | `./.venv/Scripts/python.exe -m black .` |
64-
| **Inspect** | `./.venv/Scripts/python.exe scripts/inspect_cbor_capture.py <file> --detect-issues` |
64+
| **Inspect CBOR wire captures** | `./.venv/Scripts/python.exe scripts/inspect_cbor_capture.py <file> --detect-issues` |
6565

6666
## Quality & Testing Standards
6767

@@ -82,7 +82,11 @@ When working on specs, the user will invoke `/kiro:*` commands. Follow the instr
8282
- **Paths**: Use `pathlib` or `/` forward slashes (Windows accepts them).
8383
- **Errors**: Don't use bare `except Exception`. Log with `exc_info=True`.
8484

85+
## Debugging
86+
87+
- **Create repro scripts**: If you cannot reproduce based on user-provided context create repro script first.
88+
8589
## Reporting Back To The User
8690

87-
- **NEVER** claim you successfully fixed a bug or implemented a feature if you're not 100% sure. The only way to be sure is to run tests.
88-
- **ALWAYS** prove correctness by running tests.
91+
- **NEVER** claim you successfully fixed a bug or implemented a feature if you're not 100% sure. The only way to be sure is to run tests and/or demo script(s).
92+
- **ALWAYS** prove correctness by running tests before reporting back to the user.

docs/user_guide/cli-parameters.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ Configuration is resolved in the following order (highest to lowest priority):
118118
| :--- | :--- | :--- |
119119
| `--log-level LEVEL` | `LOG_LEVEL` | Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL). |
120120
| `--log FILE` | `LOG_FILE` | Path to log file. |
121+
| `--log-colors` | `LOG_COLORS=true` | Enable colored log output. |
122+
| `--no-log-colors` | `LOG_COLORS=false` | Disable colored log output. |
121123
| `--capture-file FILE` | `CAPTURE_FILE` | Write raw LLM requests/replies to this file (JSON). |
122124
| `--capture-max-bytes N` | `CAPTURE_MAX_BYTES` | Max size of capture file before rotation. |
123125
| `--capture-truncate-bytes N` | `CAPTURE_TRUNCATE_BYTES` | Truncate captures to N bytes per entry. |

tests/reproduce_issue.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

tests/unit/test_tool_call_extra_content_sanitization.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def test_extra_content_removed_from_embedded_tool_calls(self) -> None:
5959

6060
# Parse the SSE data
6161
lines = result_str.strip().split("\n")
62-
data_line = [
62+
data_line = next(
6363
line for line in lines if line.startswith("data: ") and "[DONE]" not in line
64-
][0]
64+
)
6565
json_data = json.loads(data_line[6:]) # Remove "data: " prefix
6666

6767
# Verify extra_content is NOT in the output
@@ -100,9 +100,9 @@ def test_extra_content_removed_from_metadata_tool_calls(self) -> None:
100100
result_str = result.decode("utf-8")
101101

102102
# Parse the SSE data
103-
data_line = [
103+
data_line = next(
104104
line for line in result_str.strip().split("\n") if line.startswith("data: ")
105-
][0]
105+
)
106106
json_data = json.loads(data_line[6:])
107107

108108
tool_calls = json_data["choices"][0]["delta"]["tool_calls"]
@@ -148,11 +148,11 @@ def test_standard_tool_call_fields_preserved(self) -> None:
148148
result = chunk.to_bytes()
149149
result_str = result.decode("utf-8")
150150

151-
data_line = [
151+
data_line = next(
152152
line
153153
for line in result_str.strip().split("\n")
154154
if line.startswith("data: ") and "[DONE]" not in line
155-
][0]
155+
)
156156
json_data = json.loads(data_line[6:])
157157

158158
tool_calls = json_data["choices"][0]["delta"]["tool_calls"]
@@ -204,11 +204,11 @@ def test_multiple_tool_calls_all_sanitized(self) -> None:
204204
result = chunk.to_bytes()
205205
result_str = result.decode("utf-8")
206206

207-
data_line = [
207+
data_line = next(
208208
line
209209
for line in result_str.strip().split("\n")
210210
if line.startswith("data: ") and "[DONE]" not in line
211-
][0]
211+
)
212212
json_data = json.loads(data_line[6:])
213213

214214
tool_calls = json_data["choices"][0]["delta"]["tool_calls"]

0 commit comments

Comments
 (0)