Skip to content

Meta-process scaffolding refresh (pr-auto + dead-code)#19

Open
BrianMills2718 wants to merge 17 commits intoShinMegamiBoson:mainfrom
BrianMills2718:main
Open

Meta-process scaffolding refresh (pr-auto + dead-code)#19
BrianMills2718 wants to merge 17 commits intoShinMegamiBoson:mainfrom
BrianMills2718:main

Conversation

@BrianMills2718
Copy link

@BrianMills2718 BrianMills2718 commented Feb 24, 2026

This PR applies the latest meta-process scaffolding refresh:

  • adds autonomous PR helper (scripts/meta/pr_auto.py)
  • adds dead-code sensor scaffold (scripts/meta/check_dead_code.py)
  • refreshes Makefile and hook wiring
  • updates meta-pattern docs/templates in-repo

No product logic changes are intended in this refresh.

ShinMegamiBoson and others added 17 commits February 21, 2026 19:58
… and tests

New data sources cataloged with fetch scripts and validation tests:
- FEC federal campaign finance (API + bulk)
- USASpending.gov federal contracts (API)
- SAM.gov contractor registrations (API)
- SEC EDGAR public company filings (API)
- FDIC BankFind institution data (API)
- ProPublica Nonprofit Explorer / IRS 990 (API)
- Senate lobbying disclosures LD-1/LD-2 (bulk XML)
- EPA ECHO enforcement & compliance (API)
- OSHA inspection data (API)
- OFAC SDN sanctions list (bulk CSV)
- ICIJ Offshore Leaks database (bulk CSV)
- US Census Bureau ACS (API)

All scripts use Python stdlib only. 104 new tests pass (18 skip
without API keys or network). Wiki index updated with new categories.
- Replace _ThinkingDisplay with _ActivityDisplay supporting three modes:
  thinking (cyan), streaming response (green), tool execution (yellow)
- Auto-transition from thinking→streaming on first text delta
- Show step counter (Step N/max) in activity spinner
- Show tool name and key argument during tool execution
- Add engine cancellation via threading.Event (_cancel flag)
- Run agent in background thread so user can type next question
- Queue typed input during agent execution (FIFO)
- ESC key binding cancels the running agent
- Add 13 tests covering ActivityDisplay, cancellation, and queuing
Extends ToolResult with optional ImageData payload and adds a read_image
tool that reads PNG/JPEG/GIF/WebP files, base64-encodes them, and passes
them through to the model layer in provider-specific formats (Anthropic
content blocks, OpenAI data URI in user messages).
Add 5 reusable analysis scripts:
- quickstart_investigation.py: starter template for investigations
- scripts/entity_resolution.py: entity linking pipeline
- scripts/cross_link_analysis.py: cross-referencing engine
- scripts/build_findings_json.py: report synthesis utility
- scripts/timing_analysis.py: statistical timing correlation

Fix TUI flicker by making _ActivityDisplay a Rich renderable (__rich__
protocol) so Live's 8fps auto-refresh polls state instead of feed()
forcing update() on every token delta.
Tell the agent about replay.jsonl, events.jsonl, and state.json in its
session directory so it can read its own prior transcripts and recall
earlier work within a session.
…ape sequences

Root cause: prompt_toolkit's patch_stdout() wraps sys.stdout with StdoutProxy
which corrupts Rich's ANSI escape sequences — replacing ESC bytes (0x1b) with
'?' (0x3f). This caused raw escape codes like ?[2K?[1A?[2K to appear as
visible text instead of being interpreted by the terminal.

Fix: scope patch_stdout() to only wrap session.prompt(), not the entire main
loop. During agent execution, Rich's Live writes directly to the real stdout
with correct escape sequences. Also remove the secondary prompt loop (which
compounded the issue) and switch cancellation from ESC to Ctrl+C.

Verified via PTY test: 36 correct ESC sequences, 0 corrupted (was 0/16).
Three fixes to the TUI secondary prompt:

1. patch_stdout(raw=True): preserves Rich's ANSI escape sequences instead
   of stripping ESC bytes (0x1b -> 0x3f). Root cause of visible ?[2K?[1A
   garbage.

2. Slash commands at the secondary prompt are dispatched immediately:
   /quit cancels the agent and exits, /help /status /model etc. run
   in-place. Only non-slash input is queued.

3. app.exit("") called from _run_agent's finally block unblocks the
   secondary prompt when the agent finishes, so the result is displayed
   immediately without the user having to press Enter.
After each agent turn, generate a lightweight summary (objective, result
preview, metadata) and persist it to state.json. On subsequent turns,
inject the list of prior turn summaries into the initial message so the
agent knows what it did before without re-reading full transcripts.
Forward tool_call_start and tool_call_args deltas from both OpenAI and
Anthropic streaming paths to the TUI _ActivityDisplay. The display now
shows a "Generating write_file..." header with a live content preview
extracted from the partial JSON buffer, instead of stale thinking text.
The attribute was used in run() and slash-command handling but never
initialized, causing an AttributeError on startup.
The function was called in the queued-input prompt but never defined,
causing a NameError when the agent was running and accepting queued input.
…h commands

Covers _queue_prompt_style, __init__ attributes, _on_event dispatching,
_on_step state management, _on_content_delta delegation, run loop
(empty input, quit, help, queued input, KeyboardInterrupt, agent
execution), and dispatch_slash_command for all command types.
Batch install of meta-process --minimal: commit-msg hooks (YAML-driven
prefix validation), pre-commit checks, plan workflow templates, and
pattern documentation. Hooks gracefully degrade when optional scripts
are missing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codex CLI reads AGENTS.md, Claude Code reads CLAUDE.md. Previously
these diverged silently. Now both tools read identical content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Disable unused features (claims, worktrees, acceptance_gates, messaging).
Keep commit prefix validation and plan workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Install full meta-process with claims, worktree hooks, and coordination
scripts. Add Multi-Agent Coordination instructions to CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants