Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2
updates:
- package-ecosystem: uv
directory: /
schedule:
interval: cron
cronjob: 15 5 * * *
timezone: Europe/Warsaw
open-pull-requests-limit: 1
versioning-strategy: increase-if-necessary
allow:
- dependency-name: costs
dependency-type: all
- dependency-name: goal
dependency-type: all
- dependency-name: pfix
dependency-type: all
- dependency-name: clickmd
dependency-type: all
- dependency-name: code2llm
dependency-type: all
groups:
internal-packages:
patterns:
- costs
- goal
- pfix
- clickmd
- code2llm
commit-message:
prefix: "chore(deps)"
35 changes: 35 additions & 0 deletions .github/internal-dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"schema": "goal.internal-dependencies/v1",
"packages": [
{
"name": "costs",
"repository": "semcod/costs",
"registry": "pypi",
"versioning": "semver"
},
{
"name": "goal",
"repository": "semcod/goal",
"registry": "pypi",
"versioning": "semver"
},
{
"name": "pfix",
"repository": "semcod/pfix",
"registry": "pypi",
"versioning": "semver"
},
{
"name": "clickmd",
"repository": "semcod/clickmd",
"registry": "pypi",
"versioning": "semver"
},
{
"name": "code2llm",
"repository": "semcod/code2llm",
"registry": "pypi",
"versioning": "semver"
}
]
}
36 changes: 36 additions & 0 deletions .github/workflows/internal-dependency-freshness.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Internal dependency freshness

on:
schedule:
- cron: "24 6 * * *"
workflow_dispatch:
pull_request:
paths:
- pyproject.toml
- uv.lock
- .github/internal-dependencies.json
- .github/workflows/internal-dependency-freshness.yml

permissions:
contents: read

jobs:
freshness:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install released checker
run: python -m pip install "goal==2.2.0"
- name: Verify published stable targets
run: goal dependencies --catalog .github/internal-dependencies.json --check > dependency-freshness.json
- name: Retain freshness evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: dependency-freshness
path: dependency-freshness.json
if-no-files-found: ignore
49 changes: 49 additions & 0 deletions .github/workflows/test-locked.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Locked tests

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.13"]
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Check out immutable documentation standard
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: wellmanifest/docs
ref: ebe7501063ef4f3e63ded610c2d3183010ca636e # v0.1.1
path: .docs-standard
token: ${{ secrets.ORG_SYNC_PAT }}
persist-credentials: false
- name: Validate documentation placement
shell: bash
env:
DOCS_BASE: ${{ github.event.pull_request.base.sha }}
run: |
set -euo pipefail
args=(--root . --standard-revision ebe7501063ef4f3e63ded610c2d3183010ca636e)
if [[ -n "$DOCS_BASE" ]]; then args+=(--base "$DOCS_BASE"); fi
python .docs-standard/docs/standard/check.py "${args[@]}"
- run: python -m pip install uv
- name: Install locked test dependencies
run: uv sync --locked --extra dev --python "${{ matrix.python-version }}"
- name: Test supported Python versions
run: uv run --no-sync python -m pytest -q
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ __marimo__/
.planfile/sprints/*.bak-*
.code2llm_cache/
.cursor/
.github/
.idea/
.nlp2dsl/
.planfile/

# Linked development checkouts
/worktrees/
7 changes: 7 additions & 0 deletions .governance/docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"schema": "wellmanifest.docs/adoption/v1",
"repository": "semcod/tagi",
"standard": "wellmanifest/docs",
"source_revision": "ebe7501063ef4f3e63ded610c2d3183010ca636e",
"policy_sha256": "f6ba9c011ea1d9260e7fac3a1638a767d5ebc9f7d9b32ed51cc3aea22fe95d8c"
}
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Dokumentacja

- [Konfiguracja](configuration.md)
- [Wykrywanie dostawców](provider-detection.md)
- [Rozwiązywanie problemów](troubleshooting.md)

- [Aktualizacja i kontrola zależności wewnętrznych](information/internal-dependencies.md)
81 changes: 81 additions & 0 deletions docs/information/internal-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
{
"schema": "wellmanifest.docs/document/v1",
"id": "internal-dependencies",
"kind": "information",
"version": 1,
"title": "Aktualizacja i kontrola zależności wewnętrznych",
"status": "implemented",
"owner": "semcod/tagi",
"created": "2026-09-06",
"updated": "2026-09-06",
"review_after": "2026-09-13",
"source_revision": "8a915c6b0a8f196d3134703d2772d10ebef48ef3",
"affected_repositories": [
"semcod/tagi"
],
"evidence": [
"https://github.com/semcod/tagi/blob/8a915c6b0a8f196d3134703d2772d10ebef48ef3/pyproject.toml",
"https://pypi.org/project/goal/2.2.0/",
"https://docs.astral.sh/uv/concepts/projects/dependencies/",
"https://docs.github.com/en/code-security/reference/supply-chain-security/dependabot-options-reference"
]
}
---

# Aktualizacja i kontrola zależności wewnętrznych

<!-- docs:section purpose -->
## Cel

Utrzymywać aktualne, przetestowane zależności projektu `semcod/tagi` przy zachowaniu Pythona 3.10 jako minimalnej wersji aplikacji.

<!-- docs:section scope -->
## Zakres

Właścicielem lockfile i CI jest `semcod/tagi`. Katalog [.github/internal-dependencies.json](../../.github/internal-dependencies.json) obejmuje pięć jawnie wskazanych dystrybucji PyPI: costs, goal, pfix, clickmd i code2llm. Audyt sprawdza te z nich, które występują w uv.lock. Nie obejmuje dowolnego pakietu tylko na podstawie nazwy organizacji.

<!-- docs:section evidence -->
## Dowody

Przed zmianą wersja źródłowa wskazana w metadanych miała starsze zależności. Dodano workflow testów lockfile i audyt aktualności. W odczycie PyPI z 2026-09-06 aktualnymi stabilnymi wersjami były costs 0.2.0, goal 2.2.0, pfix 0.1.79 i clickmd 1.1.15; te wersje zapisano w uv.lock.

Lokalne testy zatwierdzanego lockfile: 72 testów przeszło bez pominięć na Pythonie 3.10 oraz 3.13. CI ujawniło porównanie pomocy CLI zależne od kodów ANSI; testy pomocy i dry-run usuwają teraz formatowanie przed sprawdzeniem treści. Wyniki publikacji i kolejnych kontroli są dostępne w [GitHub Actions](https://github.com/semcod/tagi/actions).

<!-- docs:section content -->
## Obsługa

Goal jest narzędziem automatyzacji, bez importów w kodzie aplikacji. Usunięto też starszą deklarację tool.uv.dev-dependencies; Goal ma jedno źródło deklaracji w grupie automation. Grupa `automation` wymaga Pythona >=3.12 i nie jest domyślnie instalowana z aplikacją ani dodatkiem `dev`. Zastosowano [oddzielny zakres Pythona grupy uv](https://docs.astral.sh/uv/concepts/projects/dependencies/#group-requires-python).

```bash
uv sync --locked --extra dev --python 3.10
uv run --no-sync python -m pytest -q
```

Dependabot codziennie proponuje aktualizację wewnętrznych pakietów w jednym PR. Testy uruchamiają zatwierdzony lockfile na Pythonie 3.10 i 3.13. Osobny workflow codziennie oraz po zmianie zależności w PR porównuje lockfile z najwyższymi stabilnymi wydaniami w katalogu; zachowuje raport jako artefakt. Obie automatyzacje można uruchomić ręcznie.

Ręczny audyt używa grupy narzędziowej:

```bash
uv run --locked --group automation --python 3.12 goal dependencies --catalog .github/internal-dependencies.json --check
```

Aktualizacja wybranych pakietów:

```bash
uv lock --upgrade-package costs --upgrade-package goal --upgrade-package pfix --upgrade-package clickmd --upgrade-package code2llm
```

Po aktualizacji uruchom testy, opublikuj PR, a po jego sprawdzeniu i scaleniu zsynchronizuj środowisko. CI kontroluje też położenie i metadane dokumentacji według wellmanifest/docs 0.1.1, przypiętego do `ebe7501063ef4f3e63ded610c2d3183010ca636e` w `.governance/docs.json`.

<!-- docs:section limitations -->
## Ograniczenia

Ograniczenie `>=` dopuszcza nowszą wersję, lecz nie zmienia istniejącego środowiska. `uv sync --locked` odtwarza wersje z lockfile. Codzienny PR nie jest automatycznie scalany ani wdrażany. Opóźnienie zależy od harmonogramu, testów i procesu publikacji.

Checker w CI jest przypięty do Goal 2.2.0. Jego aktualizację trzeba wykonać jawnie. Audyt tej wersji porównuje stabilne wersje x.y.z i nie jest pełnym resolverem wszystkich formatów wersji ani kontrolą pochodzenia każdego pakietu. Dokładne przypięcie standardu dokumentacji podlega osobnej, sprawdzanej aktualizacji.

<!-- docs:section next_actions -->
## Utrzymanie

Sprawdzaj nieudane harmonogramy i zaległe PR-y. Nową dystrybucję dodaj do katalogu dopiero po potwierdzeniu jej właściciela i sposobu wersjonowania. Wyniki przekrojowe rozwijaj w [kanonicznym raporcie subactor/docs](https://github.com/subactor/docs/blob/main/architecture/analysis/internal-dependencies.md). Zwiększ wersję tego dokumentu po zmianie mechanizmu.
16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ license = "Apache-2.0"
[project.optional-dependencies]
dev = [
"pytest>=7.4.0",
"goal>=2.1.0",
"costs>=0.1.20",
"pfix>=0.1.60",
"costs>=0.2.0",
"pfix>=0.1.79",
]

[project.scripts]
Expand All @@ -27,11 +26,6 @@ tagi = "tagi.cli:app"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.uv]
dev-dependencies = [
"goal>=2.1.235",
]

[tool.pytest.ini_options]
pythonpath = ["src"]
testpaths = ["tests"]
Expand Down Expand Up @@ -64,3 +58,9 @@ max_commits = 500

# Cost thresholds for badge colors (USD)
badge_color_thresholds = { low = 1.0, medium = 5.0, high = 10.0, critical = 50.0 }

[dependency-groups]
automation = ["goal>=2.2.0"]

[tool.uv.dependency-groups.automation]
requires-python = ">=3.12"
15 changes: 9 additions & 6 deletions tests/test_tagi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import tempfile
from pathlib import Path

from click import unstyle
from typer.testing import CliRunner

from tagi.models import Change, ChangeType, Tag
Expand Down Expand Up @@ -198,9 +199,10 @@ def test_send_help_uses_repo_path_option():

result = runner.invoke(app, ["send", "--help"])
assert result.exit_code == 0
assert "--repo-path" in result.stdout
assert "[TARGET]" in result.stdout
assert "[REPO_PATH]" not in result.stdout
help_text = unstyle(result.stdout)
assert "--repo-path" in help_text
assert "[TARGET]" in help_text
assert "[REPO_PATH]" not in help_text


def test_send_invalid_tag_exits_cleanly(monkeypatch):
Expand Down Expand Up @@ -242,9 +244,10 @@ def fake_apply_tags(changes, _repo_path):

result = runner.invoke(app, ["send", ".", "--auto-order", "--dry-run", "--push", "--verbose"])
assert result.exit_code == 0
assert "Sending" in result.stdout
assert "Sorting changes by complexity" in result.stdout
assert "[DRY-RUN] No changes will be made" in result.stdout
output = unstyle(result.stdout)
assert "Sending" in output
assert "Sorting changes by complexity" in output
assert "[DRY-RUN] No changes will be made" in output


def test_publish_invalid_tag_exits_cleanly(monkeypatch):
Expand Down
Loading
Loading