Skip to content

Lead build step 4: the sage:lead agent file and the docs (T181) #119

Closed

Description

@erickb336

Task: T181, step 4 of 4 (the lead build) · small · risk flag: auth · waits for step 3 (#118).

Where this fits

This is the last step: the sage:lead agent file and the docs. The draft agent file is in the #62 comments ("Draft of the sage:lead agent file").

Goal

  1. Add packages/sage-claude/agents/lead.md from the draft, with the report fields that the sage hook checks.
  2. Update the chief's instructions: for each PR, the chief starts one background lead named lead-T<n> and waits for its single report. Update the design page and the README to match.
  3. The word "lead" follows writing/dictionary.md (F3 and F4 in the T181 step 1: Lead build: the hook applies the spawn rules to nested agents #62 design).

Live check after it lands (the sage does this in Claude Code, not Codex)

  • A lead's child that tries to start an agent is refused (the third layer).
  • A grandchild's hook events carry its own agent_id and agent_type, and the main session's session_id. If they do not, the hook already fails closed on a missing agent_id. The sage then files a fix before any real use.
  • One small real task runs from start to end through a lead.

Acceptance

  • npm run check passes (agent frontmatter, dictionary, brief and report fields).
  • The PR says what the live check above must still show.

Rules for every sage task

  • Edit the sources only (packages/, principles/, writing/, preferences/). Never edit build output. Run npm run build, npm run check and npm test.
  • Use repo paths only in the PR: the repo is public. Commit with your no-reply identity.
  • Branch codex/t181-step4. The PR title ends with "(T181)", and the body has "Closes Lead build step 4: the sage:lead agent file and the docs (T181) #119".
  • Risk flag: auth. The sage runs 2 clean review cycles before it lands the PR.

Activity

  1. added
    codex
    on Oct 11, 2026
  2. erickb336 commented on Oct 12, 2026

    @erickb336
    OwnerAuthor

    Note from the sage (Claude), for Codex: the sage builds this step itself, after PR #121 (#102) merges, because each step needs a live check in Claude Code. Please do not start it.

  3. erickb336 commented on Oct 12, 2026

    @erickb336
    OwnerAuthor

    Input from step 3 (PR #124): the hook reads a lead's state tool command as one plain command with no quotes, so a lead's --summary and --reason must be one word (for example --summary=no-test-for-empty-input). The lead agent file must say so, or a later task must teach the hook simple quoted values. Also: a lead may not close its own lead run; the sage does that.

  4. erickb336 commented on Oct 12, 2026

    @erickb336
    OwnerAuthor

    Input from PR #139 (T284): a lead must name each child agent by its run id (run add --role gives R; then start the child of role r with the name R). A run counts only when its own child started and stopped; a lead's run done and verdict need that. The lead agent file must teach this order: run add, spawn the child named R, wait for its stop, run done, then the verdict with --run R.

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

    codex

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions