Skip to content

Pin backlog_metrics.py's Inline Dependency So a Token-Holding Run Resolves a Reviewed Version #3935

Closed

Description

@ptr727

The gap

scripts/backlog_metrics.py declares its one dependency inline as dependencies = ["markdown-it-py>=4"], with no upper bound and no lock file beside it. Each uv run --no-project --script therefore resolves whatever version PyPI serves at that moment.

The script needs a GitHub token in its environment, since its run_gh and graphql call gh. A downstream timer runs it weekly with a read-only, all-repository fine-grained token. So the dependency resolved at run time is imported into a process holding that token. A new upstream release, or a compromised one, would run with it.

How it surfaced

ptr727/HomeAutomation-Config #1794 added a weekly timer that runs this script as an unprivileged account, mailing its HTML. On promotion #1797 there, Copilot asked to keep GH_TOKEN out of the uv process. The script that needs the token is the one that imports the dependency, so the downstream can't split them. It declined the finding on the maintainer's call, and this issue was filed instead.

Done looks like

  • The resolve is reproducible. That means either an exact version in the inline metadata, or a uv lock --script lock file committed beside the script and used on every run.
  • A dependency bump is then a reviewed change, like any other update the hub takes.
  • The usage header says how a caller runs it so that the lock is honored.

Filed from a backlog burndown in ptr727/HomeAutomation-Config, on the maintainer's go-ahead.

Activity

  1. ptr727 commented on Nov 10, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-10): PR #4035 merged into develop at 3430a01, and its branch and worktree are removed, so this claim holds no files.

    Backlog burndown claim (attended run 2026-11-10, round 1, group G8). Branch: burndown/4033-prose-gate-markdown-it. Issues: #4033, #3935.

    Predicted file set:

    • .github/actions/prose-gate/prose_lint.py
    • .github/actions/prose-gate/prose-gate.json
    • scripts/prose_lint.py
    • tests/test_prose_lint.py
    • scripts/backlog_metrics.py
    • tests/test_backlog_metrics.py
    • tests/requirements.txt

    This group fixes a crash that fails every open pull request's CI, so it ranks first. No other group may edit these files while this claim stands. The orchestrator releases it at cleanup.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions