Skip to content

fix(roadmap): refine writes its section's end marker, so a re-refined item keeps one design section instead of two #1470

Closed

Description

@dan-petty

Problem

Checked at release/v0.2.30 (edd2578).

Proposed remedy

  • Sanitize the model-written lines, then add the start and end markers around them, so the markers are never sanitized away. No other change.

Acceptance criteria

  • A round-trip test: extract_section_and_outside(body + render_proposal_section(...)) returns the section and the original body.
  • Refining an item twice, with a body edit between, leaves exactly one design section, the second run's.
  • Model text that contains the end marker is still neutralised (the existing sanitize_text test keeps passing).
  • changelog.d/<issue>.md under ### Fixed.

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    on Oct 9, 2026
  2. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Related finding from the same runs (2026-10-09): answerable facts stay open questions

    Refining 10 P1 items in four managed repositories from the Service's pod readied 5. Three of the four left New had one open question each, every one a fact in the checkout that the model answered but cited without a path the validator accepts:

    • "Does Caddy route all apex-domain paths to event-stream?" (answered at caddy/Caddyfile:41-47, which the item's own body cites);
    • "Does the Pixelfed site block import the shared security_headers snippet?" (the model cited Caddyfile:54; the file is caddy/Caddyfile);
    • "Does the README already have an 'Offline Hosts & Returning a Node' section?" (README.md:216).

    validate_proposal demotes a fact answer whose sources all fail _is_valid_source to an open question, which is right, but the model is never shown the tracked paths, so it cites bare file names. An item left this way is skipped as unchanged on every later run, so it stays New until a person edits its body, which today duplicates its section (this item).

    Simplest fix, in the same module: have _is_valid_source accept a cited path that matches exactly one tracked file by its trailing path components (Caddyfile:54 -> caddy/Caddyfile:54) and record the resolved path, refusing an ambiguous one. Criterion: a fact answer citing Caddyfile:54 in a checkout with one caddy/Caddyfile is accepted with the full path; with two Caddyfiles it stays an open question.

  3. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. It breaks the primary re-refine path (duplicate sections) but the item remains usable and the defect is cosmetic in output rather than a data-loss or security issue.
    • Value: Medium. It corrupts the refine output for any item refined more than once, which is the intended workflow, but does not block first-time refinement or other roadmap jobs.
    • Effort: Low. The fix is a single reordering: sanitize the model text first, then wrap it in markers, with no other code change needed.
  4. added this to the v0.2.33 milestone on Oct 9, 2026
  5. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Placed in v0.2.33 by the owner, 2026-10-09, to land before #1515: hourly refine would otherwise append a duplicate design section to every item it leaves New on each run (reproduced at b5ea6ff: 3 rounds gave 3 sections). Only the marker fix is required here; the path-resolution add-on in the later comment is optional.

  6. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    Admitted to v0.2.33: after v0.2.33 started, only a critical fix can join it. A person can place it in a planned release, and that placement stands. (devops roadmap reprioritize)

  7. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Correction (2026-10-09): this issue's Problem says five issues here (#593, #599, #744, #991, #1177) already contain [end-marker]. They don't: the build's review read all five bodies, and none holds [end-marker] or a refine section. The list came from a code search that matched other text (#744 and #1177 only mention the markers in prose). The defect itself is confirmed (the new round-trip and refine-twice tests fail on the old code), and one item in a managed repository does hold two sections; that one is cleaned up by hand.

  8. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1525, merged into release/v0.2.33 as 29b3606.

    Summary

    • render_proposal_section now sanitizes the section's text and then wraps it in the start and end markers. Before, it appended the end marker first, so sanitize_text turned it into [end-marker]. extract_section_and_outside then found no section, and every later refine of the item appended another ## Proposed design section.
    • An end marker in the model's text is still neutralised to [end-marker]. Nothing else changed.
    • An item that already holds a section from before this fix (ending in [end-marker]; none in this repository, one in a managed repository) gets one correctly marked section on its next refine. Refine then skips it with "the section's hash differs from the one refine last recorded" until a person deletes the old section.
    • The optional path-resolution add-on from the issue's later comment is not part of this change.

    Closes #1470

    4 file(s) changed.

    How it was verified

    Check runs at 2d24972:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • Changed-Test Independence: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1470-refine-keeps-its-end-marker.md:

    • Round trip: extract_section_and_outside(body + render_proposal_section(...)) returns the original body and the section's text, with the model's text holding an end marker (test_a_rendered_section_keeps_its_end_marker_when_the_model_writes_one).
    • Refining an item twice, with a body edit between, leaves exactly one design section, the second run's, and keeps the edit (test_refining_twice_with_a_body_edit_between_leaves_only_the_second_section).
    • Model text that contains the end marker is still neutralised (the round-trip test above; test_sanitize_text_markdown keeps passing).
    • changelog.d/1470.md under ### Fixed.
  9. added a commit that references this issue on Oct 10, 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

    scope/roadmapsource/agenttype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions