Metadata-Version: 2.3
Name: semantic-veritas
Version: 0.5.0
Summary: CLI tool for managing semantic versioning across polyglot repositories
Author: Jonathan Belden
Author-email: Jonathan Belden <tacignis@gmail.com>
License: MIT License
         
         Copyright (c) 2026 Jonathan Belden
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Classifier: License :: OSI Approved :: MIT License
Requires-Dist: gitpython>=3.1.46
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: pydantic>=2.12.5
Requires-Dist: typer>=0.24.1
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/yourname/semantic-veritas
Project-URL: Repository, https://github.com/yourname/semantic-veritas
Description-Content-Type: text/markdown

# semantic-veritas

`svt` is a CLI for managing semantic versioning across polyglot repositories via a single root `version.yml` file. It keeps version state explicit, provides optional git tagging, and can align Python package managers (`uv`/`poetry`) on bump.

All commands operate on the current working directory.

```bash
pipx install semantic-veritas
svt init
svt version
svt bump
```

---

## Version formats

| Format | Example | Notes |
|--------|---------|-------|
| `X.Y` | `3.13` | Two-segment; default bump increments minor |
| `X.Y-label` | `3.13-260819` | Two-segment with alphanumeric suffix |
| `X.Y.Z` | `1.2.3` | Standard semver |
| `X.Y.Z.b` | `1.2.3.4` | Semver with optional build segment |
| `X.Y.Z-label` | `1.2.3-rc1` | Any numeric format accepts a label suffix |

Labels are alphanumeric only (`[a-zA-Z0-9]+`, no dashes or dots).

---

## version.yml

```yaml
name: my-project
version:
  current:
    semver: '1.4.2'
    build: null
    tag_suffix: null
  previous:
    semver: '1.4.1'
    build: null
    tag_suffix: null
manifest: pyproject.toml   # optional
```

---

## Commands

### `svt init`

Creates `version.yml` in the current directory.

```bash
svt init                          # auto-discover manifest
svt init --manifest Cargo.toml    # use a specific manifest
```

Supported manifests: `pyproject.toml`, `package.json`, `Cargo.toml`, `go.mod`. When exactly one is present it is used automatically; with multiple, `svt` prompts. With none, name defaults to the directory name and version to `0.1.0`.

---

### `svt bump`

Increments `version.current` and moves the prior value to `version.previous`.

```bash
svt bump                          # patch +1 (default for X.Y.Z)
svt bump --minor                  # minor +1, patch reset
svt bump --major                  # major +1, minor/patch reset
svt bump --build                  # increment build segment
svt bump --label rc1              # append label to bumped version
svt bump --skip-sync              # skip package-manager alignment
svt bump --tag "release note"     # tag + push after bump
```

Two-segment versions (`X.Y`) default to minor bump + a YYMMDD label. Pass `--label` to override.

**Python alignment:** after a successful bump, if `pyproject.toml` is the authoritative manifest and a `uv.lock` or `poetry.lock` is present, `svt` runs `uv version <new>` or `poetry version <new>` to keep the manifest in sync. Use `--skip-sync` to bypass this. On any failure, `version.yml` is reverted and the command exits non-zero.

---

### `svt set <version>`

Sets an explicit version.

```bash
svt set 2.0.0
svt set 3.13 --label rc1         # result: 3.13-rc1
svt set 2.0.0 --tag "major GA"
```

Does not run package-manager alignment.

---

### `svt project`

The primary inspection command. With no flags, prints the raw `version.yml` contents. Use `--tag` to create and push a git tag for the current version. For the tool version, use `svt -V`.

```bash
svt project                       # raw file
svt project -q                    # name, then version (two lines)
svt project -n                    # name
svt project -v                    # current version
svt project -p                    # previous version (empty if unset)
svt project -m                    # manifest path (empty if unset)
svt project -d                    # <name>/<name>:v<version>
svt project -n -v -p -m          # all fields, fixed order
svt project --tag "GA release"    # tag + push current version
```

---

### `svt reconcile`

Refreshes `name`, `version.current`, and `manifest` in `version.yml` from a manifest file.

```bash
svt reconcile                     # use stored or discovered manifest
svt reconcile --manifest package.json
```

If the manifest version is valid semver, `version.current` is updated and `version.previous` is cleared. If the manifest version is absent or invalid, `name` is updated but `version.current` is kept. No change writes if already aligned.

---

## Manifest resolution

On `bump` and `reconcile`, the authoritative manifest is resolved in this order:

1. `--manifest <path>` when passed explicitly
2. `manifest` key in `version.yml` when set and the file exists
3. Auto-discovery: single match → used automatically; multiple → prompt; none → fails with guidance

---

## Requirements

- Python ≥ 3.11
- Dependencies: `pydantic`, `typer`, `pyyaml`, `gitpython`

---

## License

MIT
