Skip to content

fix(roadmap): judge a pyproject tool setting by its diff #3491

Description

@devops-cli-service

Split from #3212.

Problem: Case 2163 changes only a coverage setting in pyproject.toml and .github/workflows/ci.yml, and it carries a spec delta that openspec/config.yaml forbids. The path-only rule in _needs_no_spec cannot tell a tool setting from a dependency or an entry point. The case is in tests/fixtures/roadmap_eval/stage/2163-coverage-measures-branches-and-ci-keeps and tests/fixtures/roadmap_eval/stage/2163-coverage-measures-branches-and-ci-keeps holds its case.json data. Why deferred: A correct fix needs a diff-aware check of pyproject.toml. Issue #3212 fixes root documents and the knowledge-base prefix. This part stays out so #3212 can reach Ready. Acceptance criteria: A plan that changes only a tool setting in pyproject.toml and a workflow, and gives a spec delta, is refused with the problem These paths need no spec delta. A plan that changes a dependency or an entry point in pyproject.toml and gives a spec delta is accepted. The replay judges case 2163 with the gate paths, and removes its reason from case.json.

Proposed design

Problem statement

Case 2163 changes only a coverage setting in pyproject.toml and .github/workflows/ci.yml. It also gives a spec delta, which openspec/config.yaml forbids. The path-only rule in _needs_no_spec cannot tell a tool setting from a dependency or an entry point. The fix judges the pyproject.toml diff by its TOML table paths.

Acceptance criteria

Requirement: Tool-setting diff needs no spec delta

The gate SHALL treat a pyproject.toml diff as a tool setting when every changed TOML key is under a [tool.*] table.

Scenario: Coverage setting only

  • WHEN A plan changes only [tool.coverage.report] in pyproject.toml and a workflow, and gives a spec delta.
  • THEN The gate returns the problem These paths need no spec delta.

Requirement: Dependency diff keeps a spec delta

The gate SHALL accept a spec delta when the pyproject.toml diff changes a dependency under [project].

Scenario: Dependency added

  • WHEN A plan adds a package to project.dependencies in pyproject.toml and gives a spec delta.
  • THEN The gate returns no problem.

Requirement: Entry-point diff keeps a spec delta

The gate SHALL accept a spec delta when the pyproject.toml diff changes an entry point under [project.scripts].

Scenario: Entry point changed

  • WHEN A plan changes project.scripts.devops in pyproject.toml and gives a spec delta.
  • THEN The gate returns no problem.

Requirement: Replay judges case 2163

The replay SHALL judge case 2163 with the gate paths and no reason.

Scenario: Case 2163 replay

  • WHEN The roadmap stage eval replays case 2163.
  • THEN The case has gate paths, no reason, and the replay passes.

Requirement: Tests cover both classes

The test suite MUST cover a tool-setting diff and a dependency diff for _needs_no_spec.

Scenario: Gate tests

  • WHEN The test module tests/roadmap/test_roadmap_stage_eval_gates.py runs.
  • THEN It asserts the refusal for a tool-setting diff and the acceptance for a dependency diff.

Existing Tool Considered

No alternatives check has run. The closest open, maintained tools are Python's tomllib, which parses TOML but cannot classify a diff hunk, and the pinned unidiff, which parses a unified diff but knows no TOML table path. Neither covers the full need, so the project must write the table-path classifier. Cost: about 20k tokens to build, 2k tokens for each later change, 5k tokens for each defect, and 1 day elapsed.

Key questions

  • Which pyproject.toml changes need no spec delta?: A change needs no spec delta only when every changed TOML key is under a [tool.*] table. Any key outside [tool.*] needs a spec delta. (best practice) [sources: pyproject.toml, openspec/config.yaml, src/devops_cli/roadmap/stage_change.py:465]
    • Rejected: Path-only rule. It cannot tell a tool setting from a dependency or an entry point, which is the defect in case 2163.
    • Chosen: TOML table-path diff. It names the changed key's table and separates [tool.*] from [project] and [build-system].
    • Rejected: Treat every pyproject.toml change as needing a spec delta. It refuses a valid tool-only change and keeps case 2163 failing.
  • How does the gate resolve a changed line in pyproject.toml to its TOML table?: The gate reads the unified diff with unidiff. It uses each hunk's line numbers and the base pyproject.toml to find the nearest [table] header. It also reads added table headers. It classifies each changed key by the full table path. (best practice) [sources: pyproject.toml, src/devops_cli/roadmap/stage_change.py:465]
    • Rejected: Hunk context only. A table header can sit outside the three lines of hunk context, so the gate would misclassify a deep key.
    • Chosen: Hunk line numbers plus the base file. It resolves a header outside the hunk context and needs no complete head file.
    • Rejected: Match the file path only. It repeats the defect that case 2163 exposes.
  • What exact problem text does the gate return for a tool-setting diff that carries a spec delta?: These paths need no spec delta. [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_eval_gates.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 4, 2026
  2. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    ContributorAuthor

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

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It fixes a correctness gap in the spec-delta gate but does not block a release or expose a security risk.
    • Value: Medium. It prevents a false acceptance of a spec delta on a tool-setting-only change, improving gate accuracy.
    • Effort: Medium. It requires a diff-aware inspection of pyproject.toml to distinguish tool settings from dependencies and entry points.
    • Related: fix(roadmap): Refuse a spec delta on root documents #3212, which asks for a different change. Both refine the _needs_no_spec rule in stage_change.py, but #3212 handles root documents and knowledge-base prefixes while this item handles pyproject.toml tool settings.
  3. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at f481be8. A bot opened the item, so a review of the issue and of the proposal must approve it first. The review found the defects below. A person edits the body to answer them. The next refine round looks at the item again only after a body edit.

    • false_premise at existing_tool and key_questions[1]: The plan says unidiff is pinned in the project. No file or issue text supports this. The chosen design depends on unidiff to read the diff. Evidence: "the pinned unidiff, which parses a unified diff but knows no TOML table path"
  4. dan-petty commented on Nov 6, 2026

    @dan-petty
    Owner

    Returned to New under AGENTS.md rule 2: the item cannot be built as written. Two reviewers read the code of origin/main on 2026-11-06 and agreed.

    Evidence

    The need is real: the case 2163 reason in tests/fixtures/roadmap_eval/stage/2163-coverage-measures-branches-and-ci-keeps/case.json says the rule lists only tests/, .github/workflows/, docs/ and openspec/, and _needs_no_spec (stage_change.py:525) judges only path prefixes (_NO_SPEC_PREFIXES, line 102). But the design 'read the unified diff with unidiff and the base pyproject.toml' cannot be built at stage time. The stage plan is a StageProposal of paths and text. StageGroup (stage_change.py:330) holds changes as paths and no diff or key. check_gates gets the proposal, a file list (StagedTree) and read_text of the staged commit. grep for diff or tomllib in stage_change.py finds nothing. No diff of pyproject.toml exists until the change is implemented. unidiff is pinned (pyproject.toml:80 unidiff==1.0.1; the refine judge's 'false_premise' claim is wrong), but it is used only in implement_eval_properties.py, after code exists. So the title and acceptance criteria ('judged by its diff') cannot hold for a plan.

    Re-scope for refinement

    AGENTS.md rule 2: do not write compensating code for a premise that fails. At stage time the gate sees only the path pyproject.toml, so it cannot tell a [tool.*] setting from a dependency or entry point. A correct re-scope needs a new plan field (for example, each group that changes pyproject.toml names the TOML tables it changes, and the gate checks the names against the base file with tomllib) or a decision that a pyproject.toml change alone never needs a spec delta. The first is a design change that adds a model field and a prompt rule; it changes the issue's criteria, so return it to New with this evidence. Re-scope proposal: after #3212 lands (it adds root documents to _NO_SPEC_PREFIXES and is the nearest same-function change), re-plan with a tables field, or close #3491 as not planned if the owner decides that case 2163 stays a documented known gap (its reason already records it). Same function, same files and same cause as #3212, so a skeptic may prefer MERGE_WITH #3212; the split was made on purpose so that #3212 can reach Ready, and it stays split because the design of #3491 is the part that does not hold. Command to return: uv run devops roadmap return 3491 --comment "<evidence>" --confirm.

  5. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 17, 2026
  6. added 3 commits that reference this issue on Nov 17, 2026
    2eb1a48
    4554b93
    4491f12
  7. removed
    status/in-progress
    owner/agent
    on Nov 17, 2026
  8. added a commit that references this issue on Nov 17, 2026
  9. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    ContributorAuthor

    Live since 2026-11-17 09:25 UTC

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/mediumpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions