Skip to content

fix: agent --help text rotted in feature, build and bug #702

Closed

Description

@Jammy2211

Overview

feature.sh, build.sh and bug.sh print their --help by slicing their own header with hardcoded sed line ranges. The ranges have rotted: feature --help leaks set -uo pipefail, build --help stops before --rehearsal-run-id, --dry-run, --json and the exit codes, and bug --help leaks an internal comment. This switches all three to the header-help awk that health.sh, rehearse.sh, validate.sh and nightly.sh already use, and adds a test.

Plan

  • Replace the sed -n '2,NNp' help in feature, build and bug with the shared header awk (print comment lines after the shebang, stop at the first non-comment line).
  • Add a test that runs each of the three with --help, asserts no line starts with set , and that build's help names --rehearsal-run-id and the exit codes.
  • Run the PyAutoBrain test suite.
  • Tier + merge mode: effective level: supervised; merge mode: auto-merge on green (this session: PR opened, merge left to the human).
Detailed implementation plan

Affected Repositories

  • PyAutoBrain (primary)

Branch Survey

Repository Current Branch Dirty?
./organs/PyAutoBrain main clean

Suggested branch: feature/agent-help-text-rot

Implementation Steps

  1. agents/conductors/feature/feature.sh:49, agents/conductors/build/build.sh:97, agents/conductors/bug/bug.sh:50: replace the sed slice with awk 'NR==1{next} /^#/{sub(/^# ?/,""); print; next} {exit}' "${BASH_SOURCE[0]}", as in agents/conductors/health/health.sh:86.
  2. New tests/test_agent_help_text.py: run each script with --help (subprocess, bash), assert exit 0, no output line starts with set , help is non-empty; build's output contains --rehearsal-run-id, --dry-run, --json and Exit codes.
  3. Run pytest tests/.

Key Files

  • agents/conductors/feature/feature.sh
  • agents/conductors/build/build.sh
  • agents/conductors/bug/bug.sh
  • agents/conductors/health/health.sh (reference pattern)

Original Prompt

Click to expand starting prompt

Agent --help text is rotted in feature, build and bug

Type: bug
Target: PyAutoBrain
Repos:

  • PyAutoBrain
    Difficulty: medium
    Autonomy: supervised
    Priority: normal
    Status: formalised
    Consequence: notify
    Witness: a test runs each of the three with --help and asserts no line starts with set and that build's output names --rehearsal-run-id and the exit codes.
    Review-minutes: 0
    Unattended: ready
    Lane: any

Agent --help text is rotted in feature, build and bug

Type: bug
Target: PyAutoBrain
Lane: any

Three shell agents print rotted --help text because they slice their own header with hardcoded sed line ranges. In @PyAutoBrain: agents/conductors/feature/feature.sh:49 leaks set -uo pipefail into --help; agents/conductors/build/build.sh:97 truncates the help before --rehearsal-run-id, --dry-run, --json and the exit codes; agents/conductors/bug/bug.sh:50 leaks an internal comment. health.sh, rehearse.sh, validate.sh and nightly.sh already use a header-help awk that stops at the first non-comment line; use the same in these three. Found in the 2026-11-22 refactor review (PyAutoBrain#700).

Witness: a test runs each of the three with --help and asserts no line starts with set and that build's output names --rehearsal-run-id and the exit codes.

Activity

  1. Jammy2211 commented on Nov 22, 2026

    @Jammy2211
    ContributorAuthor

    Library PR opened: #703. Heart: start_dev door read YELLOW (one unrelated euclid_assistant reason; an earlier RED came from a 2-day-old local snapshot and no longer held). The dev-ship readiness for PyAutoBrain read STALE only because Heart's CI poll hit a TLS timeout on this network; gh run list showed Brain Tests and Brain Board green on main at 428fe1e. Witness test passes; full suite 2454 passed, 1 skipped. No workspace impact. Merge is left to the human (/prm).

  2. Jammy2211 commented on Nov 22, 2026

    @Jammy2211
    ContributorAuthor

    Shipped

    Merged in #703 (2026-11-22). feature, build and bug now print --help with the shared header-help awk (comment block after the shebang, stop at the first non-comment line), so no more leaked set -uo pipefail, truncated build options or internal comments. Witness: tests/test_agent_help_text.py.

    Session note: Heart read STALE at ship time only because Heart's CI poll hit TLS timeouts on this network; accepted by the human.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions