Skip to content

STEP-07-C: lint_ticket() pre-flight gate in ticket_io.py #4

@MrSnowNB

Description

@MrSnowNB

STEP-07-C — Ticket Lint Gate

Part of: STEP-07 spec
Depends on: #3 (STEP-07-B)

What to build

Add lint_ticket(ticket: Ticket) -> List[str] to src/ticket_io.py.

Lint rules:

  • LINT-001 — task references a .py filename but context_files is empty
  • LINT-002produces/consumes declared but context_files is empty
  • LINT-003context_files references a file that does not exist on disk
  • LINT-004 — task is None or empty string

Call lint_ticket() inside write_tickets() in runner.py:

  • Warn (print) on violations — do NOT block ticket write
  • Log violations to logs/lint-violations.jsonl

Warn-not-block by design. Hard-fail comes in STEP-08 after false-positive rate measured in real runs.

Gate

pytest tests/test_ticket_io.py -v green. 4+ new tests covering each lint rule.

Files

  • src/ticket_io.py
  • agent/runner.py
  • tests/test_ticket_io.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions