Skip to content

Add local engine profiling workflow#44

Open
tony wants to merge 5 commits into
masterfrom
streamline-02
Open

Add local engine profiling workflow#44
tony wants to merge 5 commits into
masterfrom
streamline-02

Conversation

@tony
Copy link
Copy Markdown
Owner

@tony tony commented May 31, 2026

Summary

  • Adds engine-only profiling spans around discovery, planning, collection, and subprocess calls, with sanitized JSON output.
  • Extends scripts/profile_engine.py into component-oriented runs for prompt search, conversation search, grep-shaped prompt and conversation search, and prompt-source find.
  • Adds transparent capped benchmark selectors plus local $profile / $benchmark guidance in AGENTS.md, repo agent skills, and developer benchmark docs.

Refs #42. CI artifact upload remains separate in #43.

Test Plan

  • rm -rf docs/_build; uv run ruff check . --fix --show-fixes; uv run ruff format .; uv run ty check; uv run py.test --reruns 0 -vvv; just build-docs;

tony added 3 commits May 31, 2026 16:54
why: Fast-path planning work needs timings that separate engine discovery, planning, collection, and rendering costs. A dormant, sanitized profiler lets benchmarks capture those boundaries without exposing prompt text, command argv, or local paths.

what:
- Add typed engine profiling primitives with context-local spans and redacted subprocess samples.
- Add a standalone engine profiling script plus benchmark entries whose names and descriptions disclose their limits.
- Add tests for profiling phase output, subprocess redaction, default-path import avoidance, and benchmark coverage.
why: streamline-02 is scoped to observability, so bottleneck work needs a stable, privacy-safe way to profile command-shaped engine paths before changing planner or executor behavior.
what:
- Add profile_engine component routing for prompt search, conversation search, grep-shaped prompt and conversation search, and prompt-source find runs.
- Add explicit capped benchmark selectors for the profile-engine components.
- Cover component expansion, query redaction, result caps, and prompt/conversation scope selection with typed pytest cases.
why: streamline-02 should leave a clear, repeatable observability workflow for agents and maintainers without adding CI artifact upload or performance changes to this branch.
what:
- Document profile_engine components and the required pre-commit gate in AGENTS.md and developer docs.
- Add repo-local $profile guidance and extend $benchmark with component selectors.
- Test that repo-local agent skills keep the component argument and core profiler components visible.
why: The profile_engine all component accepts content search terms for search-like runs, but find-prompts enumerates prompt sources rather than prompt contents. Passing those terms into find-prompts made batch profiles undercount source enumeration versus the standalone profiler benchmark.
what:
- Make ProfileRunSpec explicitly opt legacy find into using terms as a source metadata pattern.
- Report effective term_count per component so batch find-prompts shows no find pattern was applied.
- Add regression coverage for all tmux find-prompts parity and legacy find term filtering.
why: Engine profiles need both machine-readable child-run streams and a readable top-spans view so bottleneck evidence can be inspected without exposing local paths or query text.

what:
- Add json, ndjson, and rich renderers to scripts/profile_engine.py.
- Keep the existing JSON document shape as the default while flattening batch runs for NDJSON.
- Cover renderer behavior and entry-point parsing with profile-engine script tests.
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