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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ development work, not a claim that a public release has been published.

### Added

- Repository safeguards requiring CI before merging into `main`, protecting
version tags from updates/deletion, and enabling immutable future releases.
- Windows-native PDF OCR through PDFium and `Windows.Media.Ocr`, with a
Direct-RAM pipeline and a fast path for embedded scan images.
- Dynamic OCR language discovery, short language-code resolution, saved default
Expand Down
26 changes: 18 additions & 8 deletions PROJECT.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,8 @@ matnocr = "matnocr.cli:app"

The console entry point launches `matnocr`; `python -m matnocr` is also
available. Local wheel/sdist builds, archive checks, fresh wheel installation,
and CLI smoke checks have passed on Python 3.13. Validation on the GitHub runner
and across the full Python matrix remains part of the CI and packaging roadmap.
and CLI smoke checks have passed locally on Python 3.13 and on GitHub's
`windows-2025` runner across Python 3.11–3.14. Publishing remains planned work.

## 16. Installation for Users

Expand Down Expand Up @@ -830,14 +830,16 @@ with:
GitHub Actions CI is configured in `.github/workflows/ci.yml`. It runs on
pushes to `main`, pull requests targeting `main`, and manual dispatch. The
application jobs use `windows-2025` with Python 3.11, 3.12, 3.13, and 3.14.
The first hosted run must still confirm compatibility and actual OCR capability
availability; Windows Server language packs must not be assumed to match a
Windows desktop.
The hosted matrix has passed on all four Python versions. The verified runner
provides `en-US`: 142 tests pass per version, and German and Arabic OCR tests
skip their missing language packs. Locally, all 144 tests pass on Python 3.13
with those packs installed. Hosted results do not establish real German or
Arabic OCR compatibility on every Python version.

The workflow pins uv 0.12.19 and action commit SHAs, uses read-only repository
permissions, and does not publish packages. A final `CI` job combines the Windows
matrix results and can become the required branch-protection check after the
first successful hosted run. This gate uses Ubuntu only to combine results.
matrix results and is required by the active `main` ruleset, with branches
required to be up to date. This gate uses Ubuntu only to combine results.

Configured workflow:

Expand All @@ -857,7 +859,7 @@ Checkout

### Python Matrix

Configured CI versions, pending their first successful hosted evaluation:
Successfully tested CI versions:

```text
3.11
Expand Down Expand Up @@ -937,6 +939,14 @@ GitHub Release

All artifacts for a version should come from exactly the same Git tag.

The active `Protect version tags` ruleset blocks updates and deletion of `v*`
tags without bypass exceptions; new tags can still be created. Release
immutability is enabled for future GitHub releases. Prepare a draft with all
assets and checksums before publishing it, since published assets and the
associated tag become immutable. Corrections require a new version. See
[the release protection guide](docs/releases.md). Publishing automation remains
planned work.

## 22. PyPI

The project is intended to be published on PyPI later.
Expand Down
48 changes: 29 additions & 19 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ actual OCR
- [x] lokalen Git-Remote setzen
- [x] ersten Commit pushen
- [x] Issue-Formulare auf GitHub prüfen
- [ ] PR-Vorlage beim ersten echten Pull Request auf GitHub prüfen
- [x] PR-Vorlage beim ersten echten Pull Request auf GitHub prüfen (PR #1)
- [x] privates Vulnerability Reporting aktivieren und den Meldeweg in `SECURITY.md` prüfen
- [x] Moderationsmeldeweg in `CODE_OF_CONDUCT.md` festlegen: GitHub-Meldetools, bewusst keine öffentliche E-Mail-Adresse und kein direkter privater Projektkontakt

Expand All @@ -419,12 +419,19 @@ pdf-ocr
offline-ocr
```

### 27. Branch Protection später aktivieren
### 27. Branch- und Release-Schutz aktivieren

- [x] Pull Requests vor Merge
- [ ] CI muss erfolgreich sein (Check `CI` nach erstem erfolgreichen GitHub-Lauf verpflichtend machen)
- [x] CI muss erfolgreich sein (Check `CI` von GitHub Actions verpflichtend; Branch muss aktuell sein)
- [x] versehentliches Force Push verhindern
- [ ] Tags / Releases schützen
- [x] Tags / Releases schützen
- [x] aktives Tag-Ruleset `Protect version tags` für `v*`: Änderungen und Löschungen gesperrt, keine Bypass-Ausnahmen
- [x] Release Immutability für zukünftige GitHub Releases aktivieren

Neue Versions-Tags können weiterhin erstellt werden. Für Releases zuerst einen
Entwurf mit allen Assets vorbereiten und erst anschließend veröffentlichen.
Veröffentlichte Assets sind dann unveränderlich; Korrekturen erhalten eine neue
Version. Einrichtung und Ablauf stehen in `docs/releases.md`.

## Phase 6 – GitHub CI

Expand All @@ -451,33 +458,35 @@ Schritte:
- [x] gebauten Wheel installieren
- [x] CLI Smoke Test

Der Workflow ist implementiert und lokal unter Python 3.13 geprüft.
Der erste ausgeführte Hosted-Testlauf zeigte CLI-Tests mit einer Abhängigkeit
von der nicht versionierten `prototype.py` sowie von Typer erzwungene ANSI-Codes.
Die Tests erzeugen nun eigene Eingabepfade; der Workflow deaktiviert erzwungene
Terminalformatierung. Lokal bestehen damit alle 144 Tests auch mit den
CI-Umgebungsvariablen. Der erfolgreiche Hosted-Wiederholungslauf steht noch aus.
Der Workflow ist implementiert und auf GitHub für Python 3.11–3.14 erfolgreich
geprüft. Der [erfolgreiche Lauf auf main](https://github.com/Hasko7/matnocr/actions/runs/45465791622)
prüft alle vier Versionen einschließlich Build, frischer Wheel-Installation und
CLI-Smoke-Tests. CLI-Tests erzeugen eigene Eingabepfade; erzwungene
Terminalformatierung ist im Workflow deaktiviert.

- [ ] ersten GitHub-Lauf auf dem PR prüfen (Matrix und echte Runner-Capabilities)
- [x] ersten erfolgreichen GitHub-Lauf auf dem PR und auf main prüfen (Matrix und echte Runner-Capabilities)

### 29. Windows Runner

- [x] Windows GitHub Runner konfigurieren (`windows-2025`; erster Hosted-Lauf noch offen)
- [x] Windows GitHub Runner konfigurieren (`windows-2025`; Hosted-Lauf erfolgreich)
- [x] Runner-Image-Familie festlegen (`windows-2025`; konkrete Image-Version im Actions-Log)
- [ ] verfügbare Windows-OCR-Sprachen im ersten GitHub-Lauf untersuchen (Diagnose-Schritt konfiguriert)
- [x] verfügbare Windows-OCR-Sprachen im ersten GitHub-Lauf untersuchen: `en-US`; Deutsch und Arabisch fehlen
- [x] kleine Integrationstests im Workflow aktivieren
- [x] OCR-Sprachabhängige Tests bei fehlender Runtime oder Sprache sauber skippen

### 30. Python CI Matrix

Matrix 3.11–3.14 ist konfiguriert; erfolgreiche Hosted-Läufe noch prüfen:
Matrix 3.11–3.14 ist auf GitHub erfolgreich geprüft:

- [ ] Python 3.11
- [ ] Python 3.12
- [ ] Python 3.13
- [ ] Python 3.14
- [x] Python 3.11
- [x] Python 3.12
- [x] Python 3.13
- [x] Python 3.14

Nur nach erfolgreichem Test offiziell unterstützen.
Im Hosted-Lauf bestehen pro Version 142 Tests; zwei OCR-Integrationstests werden
wegen fehlender deutscher und arabischer Sprachpakete übersprungen. Lokal unter
Python 3.13 bestehen mit diesen Sprachpaketen alle 144 Tests. Die Hosted-Matrix
belegt damit keine reale deutsche oder arabische OCR auf allen Python-Versionen.

### 31. Security Automation

Expand Down Expand Up @@ -593,6 +602,7 @@ test
- [ ] Versionen müssen überall identisch sein
- [ ] Release nur aus getaggtem Commit
- [ ] fehlerhafte Builds dürfen nicht veröffentlicht werden
- [ ] alle Release-Assets einschließlich Checksums zuerst an einen Entwurf anhängen und erst danach unveränderlich veröffentlichen

## Phase 9 – v0.1.0 Release

Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- [Usage guide](usage.md): pages, quality, languages, output formats, and scripting.
- [Development guide](development.md): local setup, checks, and integration tests.
- [Release protection](releases.md): active tag/release safeguards and publishing order.
- [Benchmarks](benchmarks.md): historical results and measurement limitations.
- [Screenshot guide](images/README.md): filenames and capture instructions for the README images.
- [Contributing](../CONTRIBUTING.md): issue reports, pull requests, and contribution expectations.
Expand Down
13 changes: 7 additions & 6 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ languages without installing system capabilities or opening an administrative
PowerShell. CLI unit tests use synthetic language discovery.

The final `CI` job runs even if a matrix job fails or is skipped, and succeeds
only when the Windows matrix succeeds. After the first successful GitHub run,
require this check in the `main` ruleset. Do not require all possible OCR
languages or assume that a configured Python matrix is already validated:
inspect the first run and its skipped tests before marking compatibility tasks
complete. The final gate uses Ubuntu only to combine results; all application
checks run on Windows.
only when the Windows matrix succeeds. It is required by the active `main`
ruleset, which also requires branches to be up to date. The verified hosted
matrix passes on Python 3.11–3.14 with 142 tests passing per version; German and
Arabic OCR tests skip because the runner only provides `en-US`. Locally, all
144 tests pass on Python 3.13 with those language packs installed. Inspect skips
when evaluating future compatibility. The final gate uses Ubuntu only to combine
results; all application checks run on Windows.

42 changes: 42 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Release Protection

[Back to the documentation index](README.md)

## Active Repository Settings

Verified on 2026-11-24:

- The `Protect main` ruleset requires a pull request, an up-to-date branch, and
the successful `CI` check from GitHub Actions. It blocks branch deletion and
force pushes, with no bypass exceptions.
- The `Protect version tags` ruleset targets `v*` (`refs/tags/v*` in the API).
It blocks tag updates and deletions, with no bypass exceptions. New version
tags can still be created by users with the necessary repository permissions.
- GitHub release immutability is enabled for future releases. Once published,
release assets and the associated tag are locked. Release titles and notes
can still be edited.

These are GitHub repository settings; cloning the repository does not configure
them. Inspect them under **Settings → Rules → Rulesets** and
**Settings → General → Releases → Enable release immutability**.

## Publishing Order for the Future Release Workflow

Package metadata, TestPyPI/PyPI publication, Windows builds, and release
automation still have open roadmap tasks. When implementing that workflow:

1. Select a reviewed commit with successful checks, and verify that the package
version matches its new version tag, such as `v0.1.0`.
2. Run release validation and build every artifact from that same tagged commit.
3. Create a **draft release** and upload all intended assets, checksums, and
required third-party license files.
4. Verify the complete draft, then publish it. All assets must be uploaded
before publication because release immutability locks them afterward.
5. Ship corrections under a new version, such as `v0.1.1`.

Protecting tags prevents later changes; it does not by itself run tests or
guarantee that a newly created tag points to a reviewed commit. The release
workflow must enforce validation before publishing.

GitHub documents [ruleset protections](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets)
and the [draft-first workflow for immutable releases](https://docs.github.com/en/code-security/concepts/supply-chain-security/immutable-releases).