Concrete Improvements — 2026-02-28

Improvements derived from the pwsafe article revision session. See Case Study: pwsafe Article Revision (2026-02-28) for the full analysis.

Code Changes (Committed)

1. Message-ID Normalisation (commit 7f18c41)

File: orchestrator.py, function: email fetch comparison (lines ~1488–1494).

Added def _mid(s): return s.strip().strip('<>') and applied it to both sides of the Message-ID set membership test. Prevents silent fetch failures caused by bracket mismatch between LLM output (no brackets) and email parser output (with brackets).

2. Better JSON Parse Error Reporting

File: orchestrator.py, function: _parse_note_value.

When a note's JSON value cannot be parsed even after repair, the error now includes: the exact character position of the parse error, the error message from json.JSONDecodeError, and 80 characters of context either side of the failure point. Previously only the first 200 chars of the value were shown.

New Tools Created

inject_email.py

File: inject_email.py in the envoy project directory. Injects a test email directly into IMAP INBOX using IMAPClient.append(), bypassing sendmail. Useful when sendmail is unreliable (DNS failures, IPv6 issues). Should be used as the primary test injection tool going forward.

Notes Changes

pwsafe linkage restored

pwsafe (v7): added Articles/Writeup section linking to pwsafe/writeup/indexpwsafe/writeup/index (v2): updated to reference draft-v1 with description and editorial feedback summary

Pending — Not Yet Implemented

1. Action success gate — prevent status=complete reply if write_notes failed2. Complete-with-no-actions guard — reject complete status if no meaningful action dispatched3. Gathering fallback sequence — rewrite gathering state note with explicit numbered fallback steps4. Parent note update reminder — add checklist item to working state note5. Note tree explorer utility — tool to show note subtree and flag orphans6. LLM response capture for failed iterations — log raw model output when actions fail

Links

Case Study (2026-02-28) — full analysisAll improvements

version1
created2026-02-28
tags['improvements', 'bugs-fixed']