⚡ Sangsakala Proxy 🏠 Home
Skip to content

fix: JSON round-trip fidelity, concurrency starvation, and lifecycle fixes - #96

Merged
m0ver merged 2 commits into
masterfrom
agent/maintenance
Nov 3, 2026
Merged

m0ver merged 2 commits into
masterfrom
agent/maintenance

Conversation

@m0ver

@m0ver m0ver commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR merges autonomous maintenance and stability fixes from agent/maintenance into master:

1. JSON Round-Trip Fidelity & Escaping (Builder / Builders)

  • Key Escaping: Escape object keys during serialization in appendKeyValue to pair with parser unescaping.
  • Literal & Type Preservation: Parse array boolean and null literals into corresponding typed Builder values.
  • Quote Retention: Keep String values quoted even when they look like numbers, booleans, or nulls so parse/toString() cycles preserve types.
  • String Scanning: Fix JSON string scanning when strings end with escaped backslashes ("\\\\").
  • Parity: Ensure array string elements unescape cleanly upon parsing, matching object field behavior.
  • Tests: Add BuilderRoundTripTest and update BuildersTest, BuilderTest, and BuilderCharSequenceViewTest to verify round-trip fidelity.

2. Concurrency & Performance (DistributedMessageQueue)

  • Fix lock starvation in DistributedMessageQueue.take() by scoping lock acquisition strictly around pollMessage(...), releasing the lock before sleeping.

3. Application Lifecycle (ApplicationManager)

  • Fix uninstall(Application) to remove all actions registered by the target application rather than returning on the first match.

4. Logging Thread Safety (LogFormatter)

  • Replace shared unsynchronized SimpleDateFormat with thread-safe DateTimeFormatter.

5. API Cleanup (Application / AbstractApplication)

  • Remove erroneous @Deprecated annotations on setAction(String, String) to support dynamic runtime action mapping without compiler warnings.

Verification

  • Builder & Builders suites: 84/84 tests passed (BuilderTest, BuildersTest, BuilderCharSequenceViewTest, BuilderRoundTripTest).
  • DistributedMessageQueueTest, ApplicationManagerTest, LoggerTest passed.
  • MCP Tool test suites passed.

m0ver added 2 commits November 1, 2026 21:08
…d-safety, and app uninstall

- Fix escaped backslash handling in Builder and Builders JSON parsing and unescape array string elements
- Release lock between poll attempts in DistributedMessageQueue.take() to prevent starving background copy() workers, and guard against unregistered sessions
- Replace SimpleDateFormat with thread-safe DateTimeFormatter in LogFormatter
- Remove all matching actions in ApplicationManager.uninstall() and ensure initialized flag is set regardless of default.import.applications
- Undeprecate Application.setAction(String, String) for dynamic route registration
- Add unit tests covering each fix
…round trips

- Builder: escape object keys on output; keep String values quoted even when they
  look like numbers/booleans/null; add null-literal single value
- Builders: parse true/false/null array elements as Boolean/null (was String)
- Tests: add BuilderRoundTripTest; BuilderCharSequenceViewTest now expects Boolean.TRUE
@m0ver
m0ver merged commit 8efb3a9 into master Nov 3, 2026
5 checks passed
@m0ver
m0ver deleted the agent/maintenance branch November 3, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant