Skip to content

Guide Factory sessions to use structured patch tools for source edits #734

Closed

Description

@JacobStephens2

From the Oct 11–16 2026 Run retrospective, finding 14. Tracking issue: #721.

The evidence below is historical and attributed to the supplied report (repository snapshot 5504c97); it has not all been independently reproduced. Limited current-checkout checks were made at 53bb9c6. This is filed for maintainer triage, not automatic Pickup.

Requested outcome and validation

Add concise Factory guidance to prefer an available structured patch tool, such as apply_patch on Codex, for source edits. Preserve compatibility with Harnesses that expose different editing tools. The goal is to make intended context and changed regions explicit and avoid an unbounded string replacement changing unrelated matches.

Verify generated prompt examples and a representative session edit, and regenerate prompt artifacts through their source modules. Keep normal language-specific code generation and narrowly justified scripts possible; this finding does not establish that every scripted edit is wrong.

The report's optional python-is-python3 host installation is not necessary to establish safe editing behavior and should be evaluated separately if a supported command actually requires python. Prefer the explicitly supported executable over installing an alias solely to mask a failed first attempt.

Confidence is low–medium: the report identifies an over-broad replacement producing E0308 in #672, but broader impact and how much prompt guidance changes session behavior need verification.

Original finding, including evidence, proposed fixes, and confidence

14. Edits made by Python str.replace heredocs (Factory prompt and Host)

  • Evidence:
  • Fix:
    • Prompt line: "Edit files with apply_patch."
    • Host: python-is-python3.
  • Confidence: low-medium.

Activity

  1. added
    documentation
    needs-triage
    on Oct 17, 2026
  2. JacobStephens2 commented on Oct 17, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: enhancement
    Summary: Give Factory sessions concise, Harness-compatible guidance to prefer structured patch tools for source edits.

    Current behavior:
    Shared Factory guidance covers foreground task lifecycle but does not state an editing preference. The retrospective attributes one over-broad scripted replacement to an unintended source edit; this is historical evidence, not a newly reproduced failure or proof that all scripted edits are unsafe.

    Desired behavior:
    Add a short preference for an available structured patch/edit tool that identifies the intended context and changed regions. Name apply_patch where useful as an example for Codex, without assuming every Harness exposes that tool. Keep normal language-specific generation and narrowly justified scripts possible. Apply the guidance consistently to source-editing Factory sessions through the existing prompt/skill ownership model, avoiding irrelevant instructions on read-only sessions.

    Key interfaces:

    • Factory Session prompt/skill composition: place the instruction at the existing shared source-editing seam with appropriate Harness wording.
    • Generated prompt reference: regenerate through its existing source-of-truth mechanism.

    Acceptance criteria:

    • Source-editing Factory prompt/skill output expresses the structured-edit preference and does not require a nonexistent tool on another Harness.
    • The wording permits justified code generation/scripts and does not add a universal scripted-edit prohibition.
    • Existing prompt examples/targeted rendering checks agree with generated artifacts, and a representative small edit demonstrates the intended tool/context behavior where that tool is available.
    • Evidence distinguishes the historical incident from any fresh verification; no claim of measured broad productivity gain is made without a measurement.
    • The change adds no host dependency or installation step.

    Out of scope:
    Installing python aliases, changing Harness permissions, replacing editing tools, blanket bans on scripts, or broader wait/navigation/standards work tracked separately.

  3. added
    enhancement
    ready-for-agent
    in-progress
    and removed
    needs-triage
    ready-for-agent
    on Oct 17, 2026
  4. added 2 commits that reference this issue on Oct 17, 2026
  5. removed
    in-progress
    on Oct 17, 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

    documentationenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions