bitexoft-verify 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. bitexoft_verify-0.2.0/.gitignore +55 -0
  2. bitexoft_verify-0.2.0/PKG-INFO +139 -0
  3. bitexoft_verify-0.2.0/README.md +116 -0
  4. bitexoft_verify-0.2.0/pyproject.toml +58 -0
  5. bitexoft_verify-0.2.0/src/bitexoft_verify/__init__.py +3 -0
  6. bitexoft_verify-0.2.0/src/bitexoft_verify/__main__.py +4 -0
  7. bitexoft_verify-0.2.0/src/bitexoft_verify/checks/__init__.py +1 -0
  8. bitexoft_verify-0.2.0/src/bitexoft_verify/checks/a1.py +396 -0
  9. bitexoft_verify-0.2.0/src/bitexoft_verify/checks/common.py +300 -0
  10. bitexoft_verify-0.2.0/src/bitexoft_verify/cli.py +120 -0
  11. bitexoft_verify-0.2.0/src/bitexoft_verify/codes.py +68 -0
  12. bitexoft_verify-0.2.0/src/bitexoft_verify/data/README.md +13 -0
  13. bitexoft_verify-0.2.0/src/bitexoft_verify/data/a1_impossible_sample.csv +31 -0
  14. bitexoft_verify-0.2.0/src/bitexoft_verify/data/a1_match_sample.csv +31 -0
  15. bitexoft_verify-0.2.0/src/bitexoft_verify/data/a2_isolated_sample.csv +31 -0
  16. bitexoft_verify-0.2.0/src/bitexoft_verify/data/issue-codes.json +57 -0
  17. bitexoft_verify-0.2.0/src/bitexoft_verify/manifest.py +103 -0
  18. bitexoft_verify-0.2.0/src/bitexoft_verify/report.py +234 -0
  19. bitexoft_verify-0.2.0/src/bitexoft_verify/runner.py +101 -0
  20. bitexoft_verify-0.2.0/tests/conftest.py +274 -0
  21. bitexoft_verify-0.2.0/tests/golden/a1_checks.json +6620 -0
  22. bitexoft_verify-0.2.0/tests/test_a1.py +255 -0
  23. bitexoft_verify-0.2.0/tests/test_equivalence.py +296 -0
  24. bitexoft_verify-0.2.0/tests/test_issues.py +264 -0
  25. bitexoft_verify-0.2.0/tests/test_version.py +52 -0
  26. bitexoft_verify-0.2.0/tools/make_fixtures.py +118 -0
@@ -0,0 +1,55 @@
1
+ # dependencies
2
+ node_modules/
3
+ .venv/
4
+ venv/
5
+ *.egg-info/
6
+ __pycache__/
7
+ *.pyc
8
+ .pytest_cache/
9
+ .ruff_cache/
10
+ .mypy_cache/
11
+
12
+ # generated
13
+ app/dist/
14
+ dist/
15
+ build/
16
+ app/src/content/catalog.json
17
+ app/src/content/briefs.json
18
+ app/src/content/glossary-detail.json
19
+ app/src/content/check-feedback.json
20
+ verify-report.json
21
+ coverage/
22
+ htmlcov/
23
+ .coverage
24
+ *.tsbuildinfo
25
+ .vite/
26
+
27
+ # secrets and credentials: a static frontend makes anything in a .env public (docs/business/monetization.md)
28
+ .env
29
+ .env.*
30
+ !.env.example
31
+ *.pem
32
+ *.key
33
+ *.p12
34
+ *.pfx
35
+ id_rsa*
36
+ id_ed25519*
37
+
38
+ # books: never commit the PDFs (CLAUDE.md)
39
+ *.pdf
40
+ *.epub
41
+
42
+ # local tooling
43
+ .claude/settings.local.json
44
+ .vscode/
45
+ .idea/
46
+
47
+ # scratch
48
+ *.log
49
+ *.bak
50
+ *.tmp
51
+
52
+ # system
53
+ .DS_Store
54
+ Thumbs.db
55
+ Desktop.ini
@@ -0,0 +1,139 @@
1
+ Metadata-Version: 2.5
2
+ Name: bitexoft-verify
3
+ Version: 0.2.0
4
+ Summary: Verifica las entregas de los proyectos de Bitexoft: la misma herramienta en tu máquina y en CI.
5
+ Author: Bitexoft
6
+ License: Proprietary
7
+ Keywords: ai,api,education,python,verification
8
+ Classifier: Programming Language :: Python :: 3 :: Only
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Topic :: Education :: Testing
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: tomli>=2.0.1; python_version < '3.11'
16
+ Provides-Extra: api
17
+ Requires-Dist: httpx>=0.27; extra == 'api'
18
+ Requires-Dist: pyyaml>=6.0; extra == 'api'
19
+ Provides-Extra: dev
20
+ Requires-Dist: pytest>=8.0; extra == 'dev'
21
+ Requires-Dist: ruff>=0.6; extra == 'dev'
22
+ Description-Content-Type: text/markdown
23
+
24
+ # bitexoft-verify
25
+
26
+ The platform's only definition of "correct". It runs in two places and decides the same
27
+ thing in both:
28
+
29
+ | Where | When | What it is worth |
30
+ |---|---|---|
31
+ | Your machine | while you work, answers in seconds | informative |
32
+ | GitHub Actions | on every push, pinned, clean environment | **official** |
33
+
34
+ The difference shows up as `provenance.surface` in the report. The platform marks a
35
+ delivery as verified only on a green CI report.
36
+
37
+ ## Install
38
+
39
+ Python 3.10 or newer — the version Ubuntu 22.04 LTS ships, so a stock Linux works without
40
+ upgrading anything.
41
+
42
+ ```bash
43
+ pip install bitexoft-verify # core; one small dependency below 3.11
44
+ pip install 'bitexoft-verify[api]' # adds what later deliveries need to verify APIs
45
+ ```
46
+
47
+ If pip answers `requires a different Python`, check your version with `python3 -V`. The
48
+ project itself targets a newer Python than the tool does: each delivery's contract states
49
+ what it needs.
50
+
51
+ ## Use
52
+
53
+ ```bash
54
+ bitexoft-verify check A1 # verify A1
55
+ bitexoft-verify check A3 # verify A3 and, on the way, A1 and A2
56
+ bitexoft-verify check A3 --only # just A3
57
+ bitexoft-verify deliveries # what this version can verify
58
+ ```
59
+
60
+ Exit codes: `0` all green, `1` something fails, `2` could not even start.
61
+
62
+ ## `bitexoft.toml`
63
+
64
+ Organise your project however you like. You declare it here and verification reads it
65
+ from here; what is not negotiable is the **shape** of the boundaries, not their names.
66
+
67
+ ```toml
68
+ [project]
69
+ id = "chaos-sports-lab"
70
+ package = "chaoslab"
71
+
72
+ [layers]
73
+ domain = "chaoslab.domain"
74
+
75
+ [cli]
76
+ module = "chaoslab" # run as `python -m chaoslab`
77
+ # main = "main.py" # or a script, if that is your entry point
78
+ ```
79
+
80
+ ## The three gates
81
+
82
+ - **Acceptance** — that it works: the contract's symbols, impossible objects refused,
83
+ value semantics, the geometry, the entry point and its exit codes.
84
+ - **Design** — that it is built well: the domain's boundary read from the syntax tree,
85
+ your tests passing, at least one test that builds an impossible object.
86
+ - **Evidence** — that you understand it. The CLI **does not judge** this gate: it always
87
+ reports `skip` with a message. You close it on the platform by writing the why and
88
+ comparing it against the rubric.
89
+
90
+ A check never fails for something you cannot fix: if an optional dependency or a git tag
91
+ is missing, it **skips** with a message saying what to do.
92
+
93
+ ## Cumulative verification
94
+
95
+ Verifying A3 also runs A1 and A2, with inherited checks tagged `[A1]`. That is what makes
96
+ the method agile: every delivery leaves the whole project standing, and a regression in
97
+ old work shows up while verifying the new.
98
+
99
+ ## The sample files
100
+
101
+ Deliveries are verified against files the CLI ships with, not against one you wrote. For
102
+ A1 that is 30 instants crossing all three block states, plus a copy with one coordinate
103
+ off the pitch to check that bad data fails cleanly instead of printing a traceback at the
104
+ user. They are synthetic: no third-party data is distributed here.
105
+
106
+ ## Development
107
+
108
+ ```bash
109
+ pip install -e '.[dev,api]'
110
+ pytest # builds a fake learner repository and verifies it
111
+ ruff check .
112
+ python tools/make_fixtures.py # regenerate the sample files
113
+ ```
114
+
115
+ Before changing what a check says when it fails, or the layout of the output, read
116
+ [`docs/foundations/03-feedback-self-explanation-calibration.md`](../docs/foundations/03-feedback-self-explanation-calibration.md)
117
+ (the verifier's messages are the feedback a learner reads) and ADR 0002. The check ids and the report
118
+ schema are a contract with the platform: do not rename them.
119
+
120
+ ## Releasing
121
+
122
+ The version is written once, in `__version__` (`src/bitexoft_verify/__init__.py`). The pin in
123
+ `.github/workflows/verify.yml` (`cli-version`) must match its `major.minor`; a test checks it.
124
+
125
+ First release, by hand on pypi.org:
126
+
127
+ 1. Account → Publishing → *Add a pending publisher*: project `bitexoft-verify`, owner `bitexoft`,
128
+ repository `sports-lab-v1`, workflow `release-verify.yml`, environment `pypi`.
129
+ 2. In the repository settings, create the environment `pypi`.
130
+
131
+ Each release:
132
+
133
+ ```bash
134
+ git tag verify-v0.2.0 && git push origin verify-v0.2.0
135
+ ```
136
+
137
+ The workflow runs `pytest` on 3.10 and 3.12, refuses a tag that differs from `__version__`, builds
138
+ with `python -m build` and publishes with trusted publishing (no tokens). Check it in a clean
139
+ environment: `pipx run --spec bitexoft-verify bitexoft-verify deliveries`.
@@ -0,0 +1,116 @@
1
+ # bitexoft-verify
2
+
3
+ The platform's only definition of "correct". It runs in two places and decides the same
4
+ thing in both:
5
+
6
+ | Where | When | What it is worth |
7
+ |---|---|---|
8
+ | Your machine | while you work, answers in seconds | informative |
9
+ | GitHub Actions | on every push, pinned, clean environment | **official** |
10
+
11
+ The difference shows up as `provenance.surface` in the report. The platform marks a
12
+ delivery as verified only on a green CI report.
13
+
14
+ ## Install
15
+
16
+ Python 3.10 or newer — the version Ubuntu 22.04 LTS ships, so a stock Linux works without
17
+ upgrading anything.
18
+
19
+ ```bash
20
+ pip install bitexoft-verify # core; one small dependency below 3.11
21
+ pip install 'bitexoft-verify[api]' # adds what later deliveries need to verify APIs
22
+ ```
23
+
24
+ If pip answers `requires a different Python`, check your version with `python3 -V`. The
25
+ project itself targets a newer Python than the tool does: each delivery's contract states
26
+ what it needs.
27
+
28
+ ## Use
29
+
30
+ ```bash
31
+ bitexoft-verify check A1 # verify A1
32
+ bitexoft-verify check A3 # verify A3 and, on the way, A1 and A2
33
+ bitexoft-verify check A3 --only # just A3
34
+ bitexoft-verify deliveries # what this version can verify
35
+ ```
36
+
37
+ Exit codes: `0` all green, `1` something fails, `2` could not even start.
38
+
39
+ ## `bitexoft.toml`
40
+
41
+ Organise your project however you like. You declare it here and verification reads it
42
+ from here; what is not negotiable is the **shape** of the boundaries, not their names.
43
+
44
+ ```toml
45
+ [project]
46
+ id = "chaos-sports-lab"
47
+ package = "chaoslab"
48
+
49
+ [layers]
50
+ domain = "chaoslab.domain"
51
+
52
+ [cli]
53
+ module = "chaoslab" # run as `python -m chaoslab`
54
+ # main = "main.py" # or a script, if that is your entry point
55
+ ```
56
+
57
+ ## The three gates
58
+
59
+ - **Acceptance** — that it works: the contract's symbols, impossible objects refused,
60
+ value semantics, the geometry, the entry point and its exit codes.
61
+ - **Design** — that it is built well: the domain's boundary read from the syntax tree,
62
+ your tests passing, at least one test that builds an impossible object.
63
+ - **Evidence** — that you understand it. The CLI **does not judge** this gate: it always
64
+ reports `skip` with a message. You close it on the platform by writing the why and
65
+ comparing it against the rubric.
66
+
67
+ A check never fails for something you cannot fix: if an optional dependency or a git tag
68
+ is missing, it **skips** with a message saying what to do.
69
+
70
+ ## Cumulative verification
71
+
72
+ Verifying A3 also runs A1 and A2, with inherited checks tagged `[A1]`. That is what makes
73
+ the method agile: every delivery leaves the whole project standing, and a regression in
74
+ old work shows up while verifying the new.
75
+
76
+ ## The sample files
77
+
78
+ Deliveries are verified against files the CLI ships with, not against one you wrote. For
79
+ A1 that is 30 instants crossing all three block states, plus a copy with one coordinate
80
+ off the pitch to check that bad data fails cleanly instead of printing a traceback at the
81
+ user. They are synthetic: no third-party data is distributed here.
82
+
83
+ ## Development
84
+
85
+ ```bash
86
+ pip install -e '.[dev,api]'
87
+ pytest # builds a fake learner repository and verifies it
88
+ ruff check .
89
+ python tools/make_fixtures.py # regenerate the sample files
90
+ ```
91
+
92
+ Before changing what a check says when it fails, or the layout of the output, read
93
+ [`docs/foundations/03-feedback-self-explanation-calibration.md`](../docs/foundations/03-feedback-self-explanation-calibration.md)
94
+ (the verifier's messages are the feedback a learner reads) and ADR 0002. The check ids and the report
95
+ schema are a contract with the platform: do not rename them.
96
+
97
+ ## Releasing
98
+
99
+ The version is written once, in `__version__` (`src/bitexoft_verify/__init__.py`). The pin in
100
+ `.github/workflows/verify.yml` (`cli-version`) must match its `major.minor`; a test checks it.
101
+
102
+ First release, by hand on pypi.org:
103
+
104
+ 1. Account → Publishing → *Add a pending publisher*: project `bitexoft-verify`, owner `bitexoft`,
105
+ repository `sports-lab-v1`, workflow `release-verify.yml`, environment `pypi`.
106
+ 2. In the repository settings, create the environment `pypi`.
107
+
108
+ Each release:
109
+
110
+ ```bash
111
+ git tag verify-v0.2.0 && git push origin verify-v0.2.0
112
+ ```
113
+
114
+ The workflow runs `pytest` on 3.10 and 3.12, refuses a tag that differs from `__version__`, builds
115
+ with `python -m build` and publishes with trusted publishing (no tokens). Check it in a clean
116
+ environment: `pipx run --spec bitexoft-verify bitexoft-verify deliveries`.
@@ -0,0 +1,58 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "bitexoft-verify"
7
+ dynamic = ["version"]
8
+ description = "Verifica las entregas de los proyectos de Bitexoft: la misma herramienta en tu máquina y en CI."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "Proprietary" }
12
+ authors = [{ name = "Bitexoft" }]
13
+ keywords = ["education", "verification", "python", "api", "ai"]
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3 :: Only",
16
+ "Programming Language :: Python :: 3.10",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Topic :: Education :: Testing",
21
+ ]
22
+ # The core stays dependency-free on modern interpreters: it installs in seconds and
23
+ # collides with nothing in the learner's environment. The single conditional dependency
24
+ # is the TOML reader, which is stdlib from 3.11 onwards.
25
+ dependencies = ["tomli>=2.0.1; python_version < '3.11'"]
26
+
27
+ [project.optional-dependencies]
28
+ api = ["httpx>=0.27", "PyYAML>=6.0"]
29
+ dev = ["pytest>=8.0", "ruff>=0.6"]
30
+
31
+ [project.scripts]
32
+ bitexoft-verify = "bitexoft_verify.cli:main"
33
+
34
+ # One source of truth for the version: `__version__`. The release workflow, the pin in
35
+ # `.github/workflows/verify.yml` and `pip show` all read it from there.
36
+ [tool.hatch.version]
37
+ path = "src/bitexoft_verify/__init__.py"
38
+
39
+ [tool.hatch.build.targets.wheel]
40
+ packages = ["src/bitexoft_verify"]
41
+
42
+
43
+ [tool.ruff]
44
+ line-length = 120
45
+ target-version = "py310"
46
+
47
+ [tool.ruff.lint]
48
+ select = ["E", "F", "I", "UP", "B", "SIM"]
49
+ # UP017 rewrites timezone.utc to datetime.UTC, which does not exist before 3.11.
50
+ ignore = ["UP017"]
51
+
52
+ [tool.ruff.lint.per-file-ignores]
53
+ # Los tests construyen el código del repositorio falso con replace() sobre literales:
54
+ # partir esas líneas los hace ilegibles.
55
+ "tests/*" = ["E501"]
56
+
57
+ [tool.pytest.ini_options]
58
+ testpaths = ["tests"]
@@ -0,0 +1,3 @@
1
+ """bitexoft-verify: the platform's only definition of "correct"."""
2
+
3
+ __version__ = "0.2.0"
@@ -0,0 +1,4 @@
1
+ from .cli import main
2
+
3
+ if __name__ == "__main__":
4
+ raise SystemExit(main())
@@ -0,0 +1 @@
1
+ """Checks, one module per delivery."""