Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .jules/palette.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Palette's Journal

## 2024-10-18 - CLI UX Adaptation
**Learning:** When a "frontend" agent encounters a CLI-only repo, the "interface" becomes the terminal output. Accessibility principles (contrast, readability, clear feedback) still apply but translate to ANSI colors, clear spacing, and descriptive log messages instead of ARIA labels.
**Action:** Adapting web-centric UX patterns (like "toast notifications") to CLI equivalents (colored log lines or summary tables).
Expand All @@ -14,3 +12,7 @@
## 2024-03-22 - CLI Interactive Fallbacks
**Learning:** CLI tools often fail hard when config is missing, but interactive contexts allow for graceful recovery. Users appreciate being asked for missing info instead of just receiving an error.
**Action:** When `sys.stdin.isatty()` is true, prompt for missing configuration instead of exiting with an error code.

## 2025-06-15 - Reduce Log Fatigue
**Learning:** High-volume success logs (like batch processing) can drown out important errors.
**Action:** Use ephemeral in-place updates (via `\r`) for repetitive "working" states to keep the log history clean for true signals (start, finish, error).
21 changes: 17 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,18 @@

try:
_api_post_form(client, f"{API_BASE}/{profile_id}/rules", data=data)
log.info(
"Folder %s – batch %d: added %d rules",
sanitize_for_log(folder_name), i, len(batch)
)

if USE_COLORS:
sys.stderr.write(
f"\r{Colors.CYAN}🚀 Folder {sanitize_for_log(folder_name)}: Pushing batch {i}/{total_batches}...{Colors.ENDC}"

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (129/100) Warning

Line too long (129/100)

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (129/100) Warning

Line too long (129/100)
)
sys.stderr.flush()
else:
log.info(
"Folder %s – batch %d: added %d rules",
sanitize_for_log(folder_name), i, len(batch)
)

successful_batches += 1
if existing_rules_lock:
with existing_rules_lock:
Expand All @@ -519,6 +527,11 @@
if hasattr(e, 'response') and e.response is not None:
log.debug(f"Response content: {e.response.text}")

if USE_COLORS:
# Clear the progress line
sys.stderr.write("\r" + " " * 80 + "\r")
sys.stderr.flush()

if successful_batches == total_batches:
log.info("Folder %s – finished (%d new rules added)", sanitize_for_log(folder_name), len(filtered_hostnames))
return True
Expand Down
Loading