Skip to content

feat(roadmap): the stage context lists sibling trees of a created file #3318

Open

Description

@dan-petty

Problem or Motivation

The plan in PR #3277 (for #3204) adds a hand-written agent skill in .claude/skills/new-scaffold/SKILL.md only. The project commits its agent skills in each agent root: .claude/skills/, .agents/skills/ and .kilocode/skills/ all hold the OpenSpec skills (CONST_OPENSPEC_GENERATED_GLOBS in src/devops_cli/config/constants.py). An agent reads only its own root, so the skill of the plan reaches one agent. The plan cites the .claude path and no other, and no gate asked whether the same kind of file lives in a sibling place.

The same shape appeared in the plan for #3236: ai_ast_graph has a sibling target_dir option that the plan missed.

Proposed Solution & Architectural Design

  1. When a task creates a file whose name matches a glob that the repository already holds in more than one tree (for example */skills/*/SKILL.md), list the sibling trees that hold files of that glob.
  2. Put the list in the context of the stage job, and ask the plan to create the file in each tree, or to say in the design why one tree is enough.
  3. Test with a plan that creates .claude/skills/x/SKILL.md alone: the stage context names .agents/skills/ and .kilocode/skills/.

Target Subsystem

src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage.py (context of the stage job).

Source: #3277

Dependencies

Proposed design

Problem statement

The stage context does not list the sibling trees of a file that a plan creates. A plan can add a skill under .claude/skills/ and miss .agents/skills/ and .kilocode/skills/. The change makes the stage context list the sibling trees. It asks the plan to cover each tree or give a reason. The same gap appeared for ai_ast_graph and target_dir.

Acceptance criteria

Requirement: Sibling trees of a created file

The stage context SHALL list every other sibling tree that holds a file matching the glob of a file that a plan creates.

Scenario: Skill tree siblings

  • WHEN A plan creates .claude/skills/new-scaffold/SKILL.md, and .agents/skills/openspec-x/SKILL.md and .kilocode/skills/openspec-y/SKILL.md exist.
  • THEN An offline unit test on a temporary tree asserts that the context names .agents/skills/ and .kilocode/skills/, and not .claude/skills/.

Requirement: No list for one tree

The stage context SHALL omit the sibling tree list when only one sibling tree holds a file that matches the glob.

Scenario: Single matching tree

  • WHEN Only .claude/skills/openspec-x/SKILL.md exists, and a plan creates .claude/skills/new-scaffold/SKILL.md.
  • THEN An offline unit test asserts that the context holds no sibling tree list.

Requirement: Prompt asks for each tree or a reason

The stage prompt SHALL ask the plan to create the file in each listed sibling tree or to state in the design why one tree is enough.

Scenario: Prompt instruction

  • WHEN The stage context lists one or more sibling trees.
  • THEN An offline test asserts that the rendered prompt holds the list and that instruction.

Requirement: Only matching relative paths

The stage context SHALL list a sibling tree only when that tree holds a file whose relative path matches the same glob.

Scenario: Same basename, different path

  • WHEN .agents/notes/SKILL.md exists and .agents/skills/openspec-x/SKILL.md does not.
  • THEN An offline unit test asserts that the context does not list .agents/notes/.

Requirement: Sorted tree names

The stage context SHALL list sibling tree names in ascending alphabetical order.

Scenario: Sorted output

  • WHEN The context lists .kilocode/skills/ and .agents/skills/.
  • THEN An offline test asserts that .agents/skills/ comes before .kilocode/skills/.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers the whole need. The Python standard library pathlib and glob cover path matching and tree search, but they lack the stage-context integration and the prompt text. The project adds that integration in its own code. The written cost is about 25,000 tokens to build, 5,000 tokens each year to keep and fix, and 1 day of elapsed time.

Key questions

  • Which agent roots already hold the same kind of skill file?: The repository holds OpenSpec skills in .claude/skills/, .agents/skills/ and .kilocode/skills/. [sources: src/devops_cli/config/constants.py]
  • Which modules build the stage context and the path helpers?: src/devops_cli/roadmap/stage.py builds the stage context. src/devops_cli/roadmap/stage_paths.py holds the path helpers. [sources: src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/stage_paths.py]
  • How does the stage context derive the glob for a created file?: Replace the first path segment and the directory segment before the file name with *. Keep the other segments exact. Match candidate files with PurePath.full_match, and list the fixed prefix of each match. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py, src/devops_cli/config/constants.py]
    • Rejected: Fixed list of known globs. It misses a new file family until a person edits the list.
    • Rejected: Same basename anywhere. It lists unrelated files and uses context space.
    • Chosen: Two-wildcard glob from the created path. It finds the */skills/*/SKILL.md family and lists the fixed prefix as the sibling tree.
  • Which module owns the sibling-tree detection?: src/devops_cli/roadmap/stage_paths.py owns the glob derivation and the match. src/devops_cli/roadmap/stage.py only renders the result in the context. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage.py]
    • Rejected: Inline in stage.py. It mixes path logic with context rendering and is harder to test.
    • Chosen: Helper in stage_paths.py. The path module already owns path rules, and a unit test can call the helper.
  • How does the stage context present the sibling trees and ask the plan to cover them?: The stage context adds a Sibling trees section. The section holds the sorted tree roots. The prompt asks the plan to create the file in each tree or to give a design reason for one tree. (best practice) [sources: src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/stage_paths.py]
    • Rejected: Inline in the stage prompt. It mixes a path fact with general instructions and is harder to test.
    • Rejected: List only. The plan can ignore the list.
    • Chosen: Separate section and instruction. The plan sees one list and one instruction, and a valid reason can keep one tree.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 3, 2026
  2. dan-petty commented on Nov 3, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It prevents a class of plan errors but affects only plans that create files matching multi-tree globs.
    • Value: Medium. It stops plans from creating a file in one agent root while missing the others.
    • Effort: Low. It adds a glob match and a tree listing to the stage context, a small targeted change.
    • Related: feat(roadmap): the stage context names open plans that edit the same files #3252, which asks for a different change. Both extend the stage context with information about related files, but 3252 names other open plans that edit the same files while the candidate lists sibling trees that hold files matching the same glob.
  3. added
    priority/p2-medium
    on Nov 3, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 3, 2026
  5. devops-cli-service commented on Nov 3, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 8e0a486 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 3, 2026

    @devops-cli-service
    Contributor

    Staged: branch feat/3318-the-stage-context-lists-the-sibling, draft pull request #3334. The pull request plans the item and closes no issue.

    The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:

    1. placeholder: 3784 tokens

    The plan run made 2 model request(s), and used 147335 input tokens and 925 output tokens. The model made no tool call.

    A model review of the plan found these points. They stop no draft, and a person judges them:

    • criterion_dropped at group 1 and specs: The plan has no task for the prompt instruction, the single-tree omission, the relative-path match or the sorted order. The spec delta holds only one requirement. The group does not change stage.py, which renders the context and the prompt. Evidence: "The stage prompt SHALL ask the plan to create the file in each listed sibling tree or to state in the design why one tree is enough."
    • verify_form at group 1: The verify command checks the OpenSpec files only. It does not run any test of the new sibling-tree code in stage_paths.py. Evidence: "uv run devops openspec check"
    • other at plan: The plan fields hold the text placeholder instead of real content: the group title, the implementation, the why and the feasibility. The group has no test task for new behavior. A reviewer cannot act on this plan. Evidence: ""implementation": "placeholder""
  7. added a commit that references this issue on Nov 3, 2026
  8. changed the title [-]feat(roadmap): the stage context lists the sibling trees of a file that a plan creates[/-] [+]feat(roadmap): the stage context lists sibling trees of a created file[/+] on Nov 3, 2026
  9. added a commit that references this issue on Nov 3, 2026
  10. 8 remaining items

  11. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261104-102842-c74b ended: succeeded.
    Image digest: sha256:68ba10ea2a5e3536c67a726812a8aaac645a24539797eb2a7cf907c8762cdf68

    The last lines of its log:

    # Implement plan for dan-petty/devops-cli
    
    ## To implement
    - #3318 feat(roadmap): the stage context lists sibling trees of a created file: Planned, new branch `feat/3318-the-stage-context-lists-the-sibling` and a new pull request
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Failure class parser. Action left: change_tier.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    Elapsed: 4m 5s
    
  12. added
    status/planned
    and removed
    owner/service
    status/blocked
    on Nov 4, 2026
  13. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Cleared the stop at group 1 by the rule digest: the runner image changed since the stop, from sha256:68ba10ea2a5e3536c67a726812a8aaac645a24539797eb2a7cf907c8762cdf68 to sha256:89bb522e53b2cf11cc1aa5746e87351306958e1be75ef01cc0bd1d203c8470f5. The item is Planned again, and the Service takes it in the next round. The Service clears a stop one time for each runner image. A new stop on this image waits for a comment implement: retry.

  14. added
    owner/service
    status/in-progress
    and removed
    status/planned
    on Nov 5, 2026
  15. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Stopped at group 1.

    Failure class: parser.
    Action taken: none.
    Action left: change_tier: run the item with a stronger model tier.

    Step Status Attempts Tokens in/out Last failing command
    group 1 stopped 1 865505/851 -

    Reason:

    ModelHTTPError: HTTP 400, model devops-coder, body: XML syntax error on line 44: unexpected EOF
    The provider failed inside the stream. A known cause is that tool call parsing failed: Ollama refuses a tool call of the model when the XML of the call is not whole (ollama/ollama issue 18563).
    

    Last message of the agent (a claim that no check verified): Now I have enough understanding to implement the feature. Let me start by implementing the sibling_trees function in stage_paths.py:

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

  16. added
    status/blocked
    and removed
    status/in-progress
    on Nov 5, 2026
  17. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261105-010536-821f ended: succeeded.
    Image digest: sha256:cb76ed2505fd18f54cfd33af3c7f966794d379f1da5b4b68340cd0bedfa3af29

    The last lines of its log:

    # Implement plan for dan-petty/devops-cli
    
    ## To implement
    - #3318 feat(roadmap): the stage context lists sibling trees of a created file: Planned, new branch `feat/3318-the-stage-context-lists-the-sibling` and a new pull request
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Failure class parser. Action left: change_tier.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    Elapsed: 9m 39s
    
  18. removed
    owner/service
    on Nov 5, 2026
  19. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.

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

    effort/lowpriority/p2-mediumscope/roadmapsource/agentstatus/blockedtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions