Skip to content

Read "poetry.lock written before Poetry 1.4" through one helper; utils::poetry_lock::lock_writer_version is dead #1847

Closed

Description

[agent] Filed by the scheduled architecture audit (audit-core). Register: register.

Kind: refactor. Register ID: A18.

Problem

The rule "formats 0, 1.0 and 1.1, or a 2.0 lock without a @generated by Poetry ≥1.4 stamp" is written twice:

Meanwhile utils::poetry_lock has a public lock_writer_version built for exactly this question, and nothing calls it except doc links: poetry_lock.rs L365-L378. source_constraint_break re-derives the same writer inline: L407-L419.

The two live copies agree today. A third reading of "who wrote this lock" is one edit away from drifting.

Proposed change

  • Keep lock_writer_version (or rename it lock_writer) as the one reader. It should return (major, minor) or the format for pre-2.0 locks.
  • Express pre_1_4_writer, the vendored inline match and source_constraint_break through it.
  • Delete the inline copies.

Size

3 files. About −25 lines.

Acceptance criteria

  • Existing hosted-poetry and vendored-poetry tests for 0/1.0/1.1/2.0 locks pass unchanged.
  • Add one unit test of the shared reader covering an unstamped 2.0 lock, a 1.4 stamp and a 2.3 stamp.

Activity

  1. added
    arch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)
    refactorStructural change: duplicated code or logic, missing abstraction, layering, dead code
    on Oct 29, 2026
  2. mikolalysenko commented on Oct 29, 2026

    @mikolalysenko
    CollaboratorAuthor

    [agent] Triaged: priority:p1 (PyPI-family: poetry), refactor. It touches the same file as #1844 (utils/poetry_lock.rs), but the cause is separate.


    Generated by Claude Code

  3. mikolalysenko commented on Oct 29, 2026

    @mikolalysenko
    CollaboratorAuthor

    [agent] Claiming this issue (shared root cause: the "written before Poetry 1.4" rule is read three ways instead of through utils::poetry_lock's one writer reader). Branch: agent/fix-poetry-lock-writer-reader. Claim-ID: 2026-10-29T23:20:46Z-933aa1


    Generated by Claude Code

  4. mikolalysenko commented on Oct 29, 2026

    @mikolalysenko
    CollaboratorAuthor

    [agent] Draft PR: #1865


    Generated by Claude Code

  5. added a commit that references this issue on Oct 29, 2026
    6abc8c5
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

    agent:triagedarch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)priority:p1refactorStructural change: duplicated code or logic, missing abstraction, layering, dead code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions