Skip to content

refactor(debugging): drop capture mode from /debugging:analyze-profile and hand capture to /app-control:drive #9183

Closed

Description

@kyle-sexton

Refs: #7581
Refs: #7555
Blocked by #9193

Summary

/debugging:analyze-profile should only analyze. Today it also records profiles: a Capture mode
that picks a profiler by symptom, launches or attaches to a process, and runs elevated commands
through a shown script. The design moves capture to /app-control:drive capture --kind ..., which
is on main (plugins/app-control/skills/drive/SKILL.md:3, :35). This slice removes capture from
analyze-profile and points capture requests at drive.

Slice D3 of PLAN Phase 13 (topic poteto-review), "Debugging: /debugging:analyze-profile only
analyzes (drop capture)". D1 (#8824, compare and retainers) and D2 (#8825, debug minimize,
pristine-copy diff, HITL note) are closed. compare already ships
(plugins/debugging/skills/analyze-profile/SKILL.md:152), so this slice adds no query feature.

Attended build (not lane). It removes skill text, and a cut to an existing skill ships only
when its evals show no loss (plugins/playbooks/skills/skill-authoring/reference/skill-criteria.md:21,
AGENTS.md Code Review Rules). The before/after eval runs and their comparison need a person to
read and accept them.

Predicted pr-merge risk: HIGH, for two reasons.

  • The diff edits scripts/em-dash-purged-paths.txt (see Fix step 7), and scripts/** is on the
    HIGH floor (plugins/source-control/skills/babysit-prs/scripts/babysit_risk.py:214).
  • It deletes the eval case plugins/debugging/evals/capture-asks-before-profiling/. At the base,
    that case's case.yaml names scaffold_script: scaffold.sh (case.yaml:7), and its
    scaffold.sh is mode 100755. A case that names a scaffold "at the base ... or on either side of
    the diff", or any mode 100755 file under plugins/<plugin>/evals/, rates HIGH as
    eval-scaffold-review-required (babysit_risk.py:48-57).

The frontmatter change itself touches only description and argument-hint, which are not
capability keys (babysit_risk.py:748).

Current behavior (origin/main ba598f0)

  • Description advertises capture mode and the trigger 'profile this process'
    (plugins/debugging/skills/analyze-profile/SKILL.md:2); argument-hint is
    [<artifact path>|capture <symptom and process>] (:3); the arguments example shows a capture
    call (:11-12).
  • The mode table has a "Capture, then load" row (:37-43).
  • ## Capture mode (:93-113): human-present rule, pick by symptom, launch under the profiler,
    attach only with consent, elevation through a script file, then load.
  • "What this skill does NOT do" names capture mode twice (:130-132).
  • reference/capture-by-symptom.md (45 lines) is loaded only by capture mode
    (capture-by-symptom.md:3; referenced from SKILL.md:102).
  • Skill evals 4, 5 and 6 test capture: capture-asks-before-launching,
    capture-refuses-with-no-one-present, elevated-attach-goes-through-a-shown-script
    (plugins/debugging/skills/analyze-profile/evals/evals.json:45-84).
  • Plugin eval cases plugins/debugging/evals/capture-asks-before-profiling/ and
    plugins/debugging/evals/capture-refuses-unattended/ test capture
    (capture-asks-before-profiling/case.yaml:3-4, capture-refuses-unattended/case.yaml:3-4).
  • plugins/debugging/README.md:18 says "or record one first with your approval".
  • plugins/debugging/prerequisites.json lists profilers for skill:analyze-profile. Some only
    record: py-spy (:37-42), jcmd (:57-62), dotnet-stack (:103-108), heaptrack (:136-141),
    gdb (:146-151), sample (:166-171), spindump (:176-181), leaks (:186-191). Some also
    read or convert an existing file in load mode: jfr (:67-72), go (:116-121), perf
    (:126-131), addr2line (:156-161); other-formats.md:10 uses perf report/perf script.
    Some degrade lines mix both: node (:27), memray (:52), dotnet-trace (:82), dotnet-gcdump
    (:95).

Callers that stay valid: /debugging:debug hands an artifact to analyze-profile
(plugins/debugging/skills/debug/SKILL.md:152, :228, :347), /performance:target
(plugins/performance/skills/target/SKILL.md:111), /testing:diagnose
(plugins/testing/skills/diagnose/SKILL.md:2), and drive's ## Next
(plugins/app-control/skills/drive/SKILL.md:83). None of them call capture mode.

Fix

  1. SKILL.md: drop the capture clause and the 'profile this process' trigger from the
    description, add a Skip clause routing a capture request to /app-control:drive capture,
    make argument-hint [<artifact path>], and drop the capture example. Replace the mode table
    with one line: no artifact means /app-control:drive capture --kind <trace|cpu|heap>, then
    come back with the file. Delete ## Capture mode. Reword the two "does NOT" bullets so the
    skill never starts the program and sends new recordings to drive. Load mode text stays.
  2. Delete reference/capture-by-symptom.md.
  3. Delete skill evals 4-6 and the two plugin eval cases above. Add one case where a capture
    request ("profile this process", no artifact) routes to /app-control:drive capture and runs
    no profiler.
  4. README.md:18: drop "or record one first with your approval".
  5. prerequisites.json: remove the record-only entries; for the read-or-convert entries and the
    mixed ones, keep the entry and reword degrade to the load-mode use only.
  6. Changelog fragment for debugging.
  7. Remove plugins/debugging/skills/analyze-profile/reference/*.md from
    scripts/em-dash-purged-paths.txt:219. After step 2 that glob matches no tracked file (the
    format pages sit under reference/formats/, which line 220 covers), and the em-dash gate fails
    on a stale entry (scripts/check-purged-em-dashes.sh:36, :250).

Open questions (decide before building)

  • Q1. Where does the symptom-to-capture table go? Drive "implements no capture and picks no
    tool of its own" and reports a gap when the control skill names no tool
    (plugins/app-control/skills/drive/SKILL.md:62-65). /app-control:map is not on main (only
    skills/drive/ exists under plugins/app-control/). Options: (a) delete the table outright;
    (b) move it to drive's reference/control-skill.md as guidance for authoring a control skill's
    ## Capture section (control-skill.md:20); (c) park it until /app-control:map lands and
    generates ## Capture. Recommendation: (b). Basis: judgment; it keeps the knowledge where a
    control skill's ## Capture gets written, without drive picking a tool.
  • Q2. Consent coverage moves or is lost. Evals 4-6 assert ask-before-launch, refuse when no
    one is present, and elevation through a shown script. Drive's evals cover unattended no-attach
    (plugins/app-control/skills/drive/evals/evals.json:6-15) and a heap gap
    (:18-31), but no attended ask-per-capture or elevated-attach case, and drive has no --attach
    on main (drive/SKILL.md:3, :11). Options: (a) land drive's attended --attach behind a
    script (PLAN Phase 13 drive line; no issue for it exists yet: searches app-control attach and
    drive --attach return only app-control: new plugin plus testing and debugging changes #7581, app-control: Electron and mobile capture #7562 and feat(app-control): add the app-control plugin with /app-control:drive #8816) first, then D3; (b) ship D3 now and record the consent gap in
    the PR; (c) port evals 4-6 into drive's suite in this slice. Recommendation: (a). Basis: judgment;
    removing the only consent-gated capture path before its replacement exists drops a guarded
    behavior.

Verification

  • git grep -n -i -E 'capture mode|capture-by-symptom|record one first' -- plugins/debugging/skills/analyze-profile/SKILL.md plugins/debugging/README.md plugins/debugging/prerequisites.json
    exits 1 (no match).
  • bash scripts/check-purged-em-dashes.sh --check exits 0.
  • test ! -e plugins/debugging/skills/analyze-profile/reference/capture-by-symptom.md && test ! -e plugins/debugging/evals/capture-asks-before-profiling && test ! -e plugins/debugging/evals/capture-refuses-unattended
    exits 0.
  • jq -e '[.evals[].name | select(startswith("capture-") or . == "elevated-attach-goes-through-a-shown-script")] | length == 0' plugins/debugging/skills/analyze-profile/evals/evals.json
    exits 0 (exits 1 on main).
  • python3 -m pytest plugins/debugging/skills/analyze-profile/scripts exits 0.
  • bash plugins/skill-quality/scripts/check-skill.sh plugins/debugging/skills/analyze-profile
    exits 0 (invocation per plugins/skill-quality/skills/check/SKILL.md:39, :105).
  • Before/after evals per skill-criteria.md:173-190: before and after run concurrently with the
    same flags; probe trigger rate with /skill-quality:check measure-invocation, and the load
    cases (skill evals 1-3, plugin cases load-mode-stops-at-mechanism,
    debug-hands-artifact-to-analyze-profile). Ship only on non-inferiority within 5 points on
    mean case score and trigger rate, with no lost case. Both reports and
    /docs-hygiene:compress compare output are linked in the PR.
  • The new routing case passes: a capture request names /app-control:drive capture and runs no
    profiler.

Related

Activity

  1. added
    needs-owner-decision
    on Oct 22, 2026
  2. added
    needs-triage
    on Oct 22, 2026
  3. github-actions commented on Oct 22, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: structural
    Basis: automated intake triage; a maintainer confirms or changes it.

    Decision recorded. The owner accepted the recommendations (2026-10-22, "Yes, go with recommended."): Q1, the symptom-to-capture table moves to drive's reference/control-skill.md; Q2, drive's attended --attach with consent evals lands first, filed as #9193. This issue is blocked by #9193.

    #9183 (comment)

    This decision settles Q1 and Q2, so I'm not asking anything new. The remaining work still needs a person. The issue calls this an attended build, and someone has to read and accept the before/after eval comparison. It is also blocked by #9193. I've applied needs-human for that. I found no likely duplicates.

    Automated triage. A maintainer reviews it.

  4. added
    needs-human
    on Oct 22, 2026
  5. kyle-sexton commented on Oct 22, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. The owner accepted the recommendations (2026-10-22, "Yes, go with recommended."): Q1, the symptom-to-capture table moves to drive's reference/control-skill.md; Q2, drive's attended --attach with consent evals lands first, filed as #9193. This issue is blocked by #9193.

  6. added
    needs-human
    and removed
    needs-owner-decision
    needs-human
    needs-triage
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-human

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions