python-traceprint 0.1.2__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 (80) hide show
  1. python_traceprint-0.1.2/.gitignore +19 -0
  2. python_traceprint-0.1.2/.macrostates/implementation/deliverables.yaml +12 -0
  3. python_traceprint-0.1.2/.macrostates/implementation/release.yaml +4 -0
  4. python_traceprint-0.1.2/.macrostates/specs/000_meta/001_concepts.md +348 -0
  5. python_traceprint-0.1.2/.macrostates/specs/000_meta/002_project-composition.md +446 -0
  6. python_traceprint-0.1.2/.macrostates/specs/000_meta/003_progressive-disclosure.md +40 -0
  7. python_traceprint-0.1.2/.macrostates/specs/000_meta/LICENSE +21 -0
  8. python_traceprint-0.1.2/.macrostates/specs/000_meta/README.md +68 -0
  9. python_traceprint-0.1.2/.macrostates/specs/000_meta/annex_cli.md +118 -0
  10. python_traceprint-0.1.2/.macrostates/specs/000_meta/annex_official-packages.md +56 -0
  11. python_traceprint-0.1.2/.macrostates/specs/000_meta/annex_package-lock.md +61 -0
  12. python_traceprint-0.1.2/.macrostates/specs/000_meta/annex_project-kick-off.md +175 -0
  13. python_traceprint-0.1.2/.macrostates/specs/000_meta/package.yaml +5 -0
  14. python_traceprint-0.1.2/.macrostates/specs/000_meta/resources/project-kickoff.md +15 -0
  15. python_traceprint-0.1.2/.macrostates/specs/001_process/001_concepts.md +536 -0
  16. python_traceprint-0.1.2/.macrostates/specs/001_process/002_artifacts.md +607 -0
  17. python_traceprint-0.1.2/.macrostates/specs/001_process/003_execution.md +1087 -0
  18. python_traceprint-0.1.2/.macrostates/specs/001_process/LICENSE +21 -0
  19. python_traceprint-0.1.2/.macrostates/specs/001_process/README.md +149 -0
  20. python_traceprint-0.1.2/.macrostates/specs/001_process/annex_conflicts.md +33 -0
  21. python_traceprint-0.1.2/.macrostates/specs/001_process/annex_exceptions.md +35 -0
  22. python_traceprint-0.1.2/.macrostates/specs/001_process/annex_project-state.md +60 -0
  23. python_traceprint-0.1.2/.macrostates/specs/001_process/annex_versioning.md +312 -0
  24. python_traceprint-0.1.2/.macrostates/specs/001_process/package.yaml +9 -0
  25. python_traceprint-0.1.2/.macrostates/specs/010_repository-1/001_conventions.md +10 -0
  26. python_traceprint-0.1.2/.macrostates/specs/010_repository-1/002_contents.md +46 -0
  27. python_traceprint-0.1.2/.macrostates/specs/010_repository-1/003_documentation.md +39 -0
  28. python_traceprint-0.1.2/.macrostates/specs/010_repository-1/004_technology.md +165 -0
  29. python_traceprint-0.1.2/.macrostates/specs/010_repository-1/LICENSE +21 -0
  30. python_traceprint-0.1.2/.macrostates/specs/010_repository-1/README.md +59 -0
  31. python_traceprint-0.1.2/.macrostates/specs/010_repository-1/package.yaml +13 -0
  32. python_traceprint-0.1.2/.macrostates/specs/020_python-1/001_python.md +90 -0
  33. python_traceprint-0.1.2/.macrostates/specs/020_python-1/LICENSE +21 -0
  34. python_traceprint-0.1.2/.macrostates/specs/020_python-1/README.md +70 -0
  35. python_traceprint-0.1.2/.macrostates/specs/020_python-1/package.yaml +9 -0
  36. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/001_project-layout.md +59 -0
  37. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/002_dependency-management.md +28 -0
  38. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/003_library-api.md +35 -0
  39. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/004_formatting.md +18 -0
  40. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/005_linting.md +20 -0
  41. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/006_type-checking.md +19 -0
  42. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/007_testing.md +26 -0
  43. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/008_packaging.md +93 -0
  44. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/009_documentation.md +29 -0
  45. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/010_examples.md +48 -0
  46. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/LICENSE +21 -0
  47. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/README.md +73 -0
  48. python_traceprint-0.1.2/.macrostates/specs/031_python-library-1/package.yaml +18 -0
  49. python_traceprint-0.1.2/.macrostates/specs/900_traceprint/README.md +32 -0
  50. python_traceprint-0.1.2/.macrostates/specs/900_traceprint/api.md +29 -0
  51. python_traceprint-0.1.2/.macrostates/specs/900_traceprint/interception.md +24 -0
  52. python_traceprint-0.1.2/.macrostates/specs/900_traceprint/package.yaml +18 -0
  53. python_traceprint-0.1.2/.macrostates/specs/900_traceprint/project.md +24 -0
  54. python_traceprint-0.1.2/.macrostates/specs/900_traceprint/release.md +76 -0
  55. python_traceprint-0.1.2/.macrostates/specs/composition.lock.yaml +202 -0
  56. python_traceprint-0.1.2/.macrostates/specs/composition.yaml +66 -0
  57. python_traceprint-0.1.2/.macrostates/specs/main.md +55 -0
  58. python_traceprint-0.1.2/CHANGELOG.md +24 -0
  59. python_traceprint-0.1.2/CONTRIBUTING.md +50 -0
  60. python_traceprint-0.1.2/LICENSE +21 -0
  61. python_traceprint-0.1.2/PKG-INFO +158 -0
  62. python_traceprint-0.1.2/README.md +135 -0
  63. python_traceprint-0.1.2/docs/api.rst +102 -0
  64. python_traceprint-0.1.2/docs/conf.py +16 -0
  65. python_traceprint-0.1.2/docs/index.rst +24 -0
  66. python_traceprint-0.1.2/docs/releasing.rst +56 -0
  67. python_traceprint-0.1.2/docs/usage.rst +162 -0
  68. python_traceprint-0.1.2/examples/main_loop.py +55 -0
  69. python_traceprint-0.1.2/examples/sklearn_style_transformer.py +76 -0
  70. python_traceprint-0.1.2/hatch_build.py +64 -0
  71. python_traceprint-0.1.2/pyproject.toml +85 -0
  72. python_traceprint-0.1.2/src/traceprint/__init__.py +25 -0
  73. python_traceprint-0.1.2/src/traceprint/colors.py +32 -0
  74. python_traceprint-0.1.2/src/traceprint/py.typed +1 -0
  75. python_traceprint-0.1.2/src/traceprint/tracer.py +520 -0
  76. python_traceprint-0.1.2/tests/integration/test_logging.py +97 -0
  77. python_traceprint-0.1.2/tests/integration/test_release.py +82 -0
  78. python_traceprint-0.1.2/tests/packaging/check_release.py +65 -0
  79. python_traceprint-0.1.2/tests/packaging/check_wheel.py +92 -0
  80. python_traceprint-0.1.2/tests/unit/test_tracer.py +146 -0
@@ -0,0 +1,19 @@
1
+ # Python/local environment
2
+ .venv/
3
+ __pycache__/
4
+ *.py[cod]
5
+ .pytest_cache/
6
+ .ruff_cache/
7
+ .mypy_cache/
8
+ .pyright/
9
+ uv.lock
10
+
11
+ # Build outputs
12
+ dist/
13
+ build/
14
+ *.egg-info/
15
+ docs/_build/
16
+
17
+ # Temporary workspace
18
+ /tmp/*
19
+ !/tmp/.gitkeep
@@ -0,0 +1,12 @@
1
+ schema_version: 1
2
+ deliverables:
3
+ traceprint:
4
+ strategy: independent
5
+ version_scheme: pep440
6
+ version: 0.1.2
7
+ status: released
8
+ specification: specs-1.0.0
9
+ implementation: imp-1.0.0
10
+ release_date: '2026-10-14'
11
+ source:
12
+ tag: v0.1.2
@@ -0,0 +1,4 @@
1
+ schema_version: 2
2
+ version: imp-1.0.0
3
+ specification: specs-1.0.0
4
+ release_date: '2026-10-14'
@@ -0,0 +1,348 @@
1
+ # Concepts
2
+
3
+ ## Specification packages
4
+
5
+ This package defines the specification package system. A specification package
6
+ is a portable set of documents that defines a coherent slice of intended
7
+ behavior, working rules, technology conventions, or project requirements.
8
+
9
+ Specification packages are designed to be copied, versioned, and reused across
10
+ projects.
11
+
12
+ ## Project layout
13
+
14
+ Projects using Meta 2 or 3 place their composition and numbered package directories
15
+ under `./.macrostates/specs/`. Process-owned implementation artifacts live
16
+ beside them under `./.macrostates/implementation/`. Track these documents,
17
+ installed packages and integrity locks in Git; a leading dot does not make them
18
+ ignored. Source, tests and ordinary tooling/runtime configuration keep their
19
+ normal locations outside `.macrostates/`.
20
+
21
+ Standalone package repositories remain portable: their own `package.yaml`,
22
+ `README.md`, core documents and resources stay at the package root. Only an
23
+ installed copy lives in a consuming project's numbered package directory.
24
+
25
+ Adopting this layout in an existing project is an explicit migration. Preserve
26
+ local requirements and historical records, move both artifact directories,
27
+ update pointers, links and subtree prefixes, then verify before committing.
28
+ Do not leave competing compositions in both locations. Projects selecting older
29
+ Meta releases retain those releases' rules; tools must not migrate them implicitly.
30
+
31
+ ## Package structure
32
+
33
+ Each package lives in its own subdirectory. The subdirectory path is local to a
34
+ project composition and is not the package identity.
35
+
36
+ The package identity comes from the `name` field in `package.yaml`. The local
37
+ directory may include ordering prefixes, grouping prefixes, or other naming
38
+ choices that help a project browse its packages.
39
+
40
+ Each package must have:
41
+
42
+ - A `package.yaml` metadata file.
43
+ - A `README.md` entrypoint file unless `package.yaml` explicitly declares a
44
+ different entrypoint.
45
+
46
+ The package entrypoint should describe the package scope and internal reading
47
+ order. It should distinguish mandatory core reading from conditional annexes
48
+ when the package uses progressive disclosure.
49
+
50
+ Use `README.md` as the normal package entrypoint because specification packages
51
+ may also be distributed as standalone repositories. This makes the same file
52
+ serve as the package entrypoint inside a composed project and as the repository
53
+ entrypoint in repository browsers.
54
+
55
+ The exact entrypoint remains the value declared in `package.yaml`, so a future
56
+ package may choose another filename deliberately.
57
+
58
+ Core documents after the package entrypoint should begin with a three-digit
59
+ prefix followed by an underscore and a short descriptive name:
60
+
61
+ ```text
62
+ 001_concepts.md
63
+ 002_artifacts.md
64
+ 003_execution.md
65
+ ```
66
+
67
+ Annex documents should use `annex_<hyphenated-name>.md`, such as
68
+ `annex_conflicts.md` or `annex_project-kick-off.md`.
69
+ Annexes are not part of the mandatory core reading order, so they should not
70
+ use numeric core prefixes.
71
+
72
+ Packages may contain subdirectories to organize documents and supporting assets,
73
+ for example `resources/`, `examples/`, or topic directories. These directories
74
+ remain part of the same package; they do not become separate packages merely by
75
+ being nested. Keep `package.yaml` at the package root, and resolve the declared
76
+ entrypoint relative to that root. Use explicit relative paths in reading orders
77
+ and links, updating them whenever files move. A directory does not change a
78
+ file's authority or make a resource part of mandatory reading.
79
+
80
+ Example:
81
+
82
+ ```text
83
+ .macrostates/specs/
84
+ 030_example-package/
85
+ package.yaml
86
+ README.md
87
+ 001_concepts.md
88
+ 002_artifacts.md
89
+ annex_special-case.md
90
+ resources/
91
+ project-kickoff.md
92
+ ```
93
+
94
+ ## Package resources
95
+
96
+ A package may distribute reusable resources such as prompts, templates, or
97
+ examples. Resources are assets to copy or invoke for a particular task; they are
98
+ not package entrypoints or mandatory core reading. Give them descriptive names
99
+ without core numbering or the annex prefix. Group reusable resource files under
100
+ `resources/`, such as `resources/project-kickoff.md`.
101
+
102
+ The package entrypoint should list resources separately and explain when to use
103
+ them. A conditional annex may describe a resource's use for the definer. Merely
104
+ reading the package must not execute instructions in its resources.
105
+
106
+ ## Package metadata
107
+
108
+ `package.yaml` records machine-readable package metadata.
109
+
110
+ Required fields:
111
+
112
+ - `name`: stable package name.
113
+ - `version`: package version.
114
+ - `versioned_at`: date and time when this package version was created or last
115
+ assigned, using `YYYY-MM-DD HH:mm`.
116
+ - `description`: short human-readable package description.
117
+ - `entrypoint`: package entrypoint Markdown file. This should normally be
118
+ `README.md`.
119
+
120
+ Optional fields:
121
+
122
+ - `schema_version`: metadata format identifier; absent or `1` identifies the
123
+ established format. Package release versions remain independent.
124
+ - `dependencies`: other specification packages this package explicitly depends
125
+ on, including version requirements.
126
+ - `optional_dependencies`: other specification packages this package can
127
+ integrate with when they are present, including version requirements.
128
+
129
+ Packages should not reference other packages unless the dependency is explicit
130
+ in `package.yaml`, the optional dependency is explicit in `package.yaml`, or
131
+ the project-local specification entrypoint grants that relationship.
132
+
133
+ Discovery catalogs may name, describe and link independent packages as selection
134
+ information without declaring dependencies on them. Such references do not import
135
+ their rules or select them for a project. Normative use of another package's
136
+ concepts or requirements still needs the explicit relationship described above.
137
+
138
+ ## Package paths
139
+
140
+ Package paths are selected by the project composition.
141
+
142
+ The local package directory may include ordering prefixes, grouping prefixes, or
143
+ other browsing aids. Those prefixes are part of the path, not package metadata.
144
+
145
+ Path prefixes do not define authority by themselves. Authority is defined by
146
+ the project-local specification entrypoint and composition metadata.
147
+
148
+ Example package metadata:
149
+
150
+ ```yaml
151
+ name: python-project-1
152
+ version: 3.0.0
153
+ versioned_at: 2026-10-13 16:08
154
+ description: Reusable Python project conventions.
155
+ entrypoint: README.md
156
+ ```
157
+
158
+ Package directory names may use prefixes for readability, such as
159
+ `030_python-project-1/`, but they do not have to. A project may use any local
160
+ path that its composition records, such as `A001_meta/`, `core/meta/`, or
161
+ `packages/python/`.
162
+
163
+ Dependencies should usually point from more concrete packages to more
164
+ fundamental packages, but this is guidance rather than a strict rule. When a
165
+ package needs concepts or rules from another package, record the dependency
166
+ explicitly.
167
+
168
+ Required dependency entries should use this structure:
169
+
170
+ ```yaml
171
+ dependencies:
172
+ - name: meta
173
+ version: 2.2.0
174
+ constraint: at_least
175
+ ```
176
+
177
+ Optional dependency entries should use the same structure under
178
+ `optional_dependencies`:
179
+
180
+ ```yaml
181
+ optional_dependencies:
182
+ - name: docker-1
183
+ version: 3.0.0
184
+ constraint: at_least
185
+ ```
186
+
187
+ Use `optional_dependencies` when a package contains conditional guidance for
188
+ another package but remains meaningful without it. For example, a Python
189
+ project package may include an annex describing how its Python rules interact
190
+ with Docker conventions. In projects that do not use Docker, the Python package
191
+ can still be used without selecting the Docker package.
192
+
193
+ An optional dependency does not activate the depended-on package by itself. The
194
+ project composition must still select that package when the project wants its
195
+ rules to apply.
196
+
197
+ Use these dependency constraints:
198
+
199
+ - `exact`: the dependency must be exactly the stated version.
200
+ - `compatible`: the dependency must have the same major version and be greater
201
+ than or equal to the stated version.
202
+ - `at_least`: the dependency must be greater than or equal to the stated
203
+ version, even across major versions.
204
+
205
+ Use `at_least` as the default when authoring reusable specification package
206
+ dependencies. State the minimum release that supplies the rules the package
207
+ needs, and write `constraint: at_least` explicitly. The same default applies to
208
+ required and optional dependencies. Omitting the constraint remains a metadata
209
+ gap; it does not silently select a default.
210
+
211
+ Keep the minimum at the earliest release that supplies the rules the package
212
+ actually needs. A new upstream release alone does not require raising that
213
+ minimum or publishing another dependent package version. Raise the minimum when
214
+ the package starts relying on newer rules; tighten the constraint when an
215
+ integration requires a narrower boundary.
216
+
217
+ Use `compatible` deliberately when a dependency's Major boundary matters to the
218
+ package's meaning or integration rules. Use `exact` when only one specific release
219
+ is acceptable. Both remain valid overrides of the authoring default.
220
+
221
+ `at_least` establishes a numeric minimum, not a guarantee that later releases
222
+ preserve all earlier rules. A future Major may remove or replace requirements.
223
+ Read the selected releases and check their actual interaction when composing a
224
+ project, even when the numeric constraints pass. Add an explicit restriction
225
+ when the package relies on behavior that later Majors may change.
226
+
227
+ Dependency constraints describe allowed choices, not automatic upgrades. The
228
+ composition selects an exact version and release tag for each package. Prefer
229
+ the latest published releases appropriate to a new project's intent, subject to
230
+ all declared constraints and semantic review. Preserve an existing project's
231
+ deliberate selections until an update is authorized.
232
+
233
+ If an implementer finds that a package dependency is missing a version or
234
+ constraint, it should treat that as a specification metadata gap and ask or
235
+ repair it during explicit specification work.
236
+
237
+ ## Versioning
238
+
239
+ Package versions use `major.minor.patch`. These rules version each reusable
240
+ package independently. They do not define the version of an entire project
241
+ composition or its implementation; those follow the project's selected policy.
242
+ See [Composition version](002_project-composition.md#composition-version) for
243
+ the optional composition field and its separate ownership.
244
+
245
+ Update the package version when changing the package during explicit
246
+ specification work:
247
+
248
+ - Increment `patch` for editorial changes that do not change meaning.
249
+ - Increment `minor` for backward-compatible additions, clarifications, or
250
+ requirements that reduce ambiguity without breaking existing users.
251
+ - Increment `major` for breaking changes to meaning, authority, required
252
+ workflow, required files, compatibility, or implementer permissions.
253
+
254
+ Implementers determine and apply the required `patch`, `minor`, or `major`
255
+ increment as part of requested specification package work. A Major increment
256
+ does not require separate definer approval. Classify the actual compatibility
257
+ impact and explain the chosen increment in the change record or review proposal.
258
+ Ask the definer when the requested requirements or compatibility expectations
259
+ are unclear; a Major increment alone is not a reason to pause.
260
+
261
+ ### Project and application identities
262
+
263
+ Distinguish four independent namespaces: a reusable package's release version,
264
+ a composed project's specification baseline, its implementation baseline, and
265
+ its application or library release versions. The selected Process policy owns
266
+ project baseline declarations, development identities, changes and finalization.
267
+ A package version does not assign any of those project or application versions.
268
+
269
+ Application versioning and release policies may be supplied by selected
270
+ technology packages or explicitly overridden by project-owned specifications,
271
+ according to composition authority. An override identifies its affected
272
+ deliverables and the replaced rule; it must not silently weaken repository-wide
273
+ integration or conformance gates. Process supplies the application version default
274
+ when no other policy applies. Monorepos may have several independent deliverables
275
+ against one composed specification and implementation baseline. Independently
276
+ composed subprojects retain their own scope.
277
+
278
+ A canonical source-only package repository is not automatically a composed
279
+ application project. Its root package documents and `package.yaml` remain the
280
+ authoritative package, released under the rules below. Do not invent a project
281
+ composition, implementation baseline or application policy merely to author or
282
+ publish that package. Adopt a Process project explicitly when it is useful.
283
+
284
+ ## Release tags
285
+
286
+ Published Git-distributed package versions use release tags named `v<version>`,
287
+ for example `v1.7.0` for package version `1.7.0`. Create an annotated release tag
288
+ in the package's own source repository on the package release commit, after
289
+ verifying its `package.yaml` version. A tag on a consuming project's subtree
290
+ merge commit does not identify the package release.
291
+
292
+ Publish the release tag together with the package release when publication is
293
+ authorized. Published release tags must never be moved, replaced, or reused for
294
+ different contents; corrections receive a new version and tag. Editing package
295
+ files or bumping metadata alone does not publish a release.
296
+
297
+ Compositions select Git-distributed releases through `source.tag`, which must
298
+ match `v` followed by the selected package version. Do not store `source.commit`.
299
+ Git may resolve tags to commits internally for verification and subtree commands,
300
+ but the tag is the persistent release selector in composition metadata.
301
+
302
+ Older compositions without tags require explicit migration: verify the release
303
+ tag against the installed package before replacing an old commit selector or
304
+ branch-only source. Never silently substitute the current branch head for a
305
+ missing release tag. See `002_project-composition.md` for source metadata rules.
306
+
307
+ ## Project selection
308
+
309
+ A project should have:
310
+
311
+ - `main.md`: the human-readable project specification entrypoint.
312
+ - `composition.yaml`: the machine-readable project package composition.
313
+
314
+ The project-level `main.md` contains project-specific specification information.
315
+ It should describe what the project is, which specification packages apply, the
316
+ authority order between them, project-specific reading instructions, and any
317
+ project-specific vocabulary.
318
+
319
+ `composition.yaml` records the package selection in a structured form. It should
320
+ list the specification packages the project uses, their versions, local
321
+ paths, sources, and project authority information that should be machine-readable.
322
+ Dependency requirements are owned by each selected package's `package.yaml`;
323
+ validate them against the selected versions without repeating them in the
324
+ composition.
325
+
326
+ When working in a project, read this package definition first, then read the
327
+ project-level `main.md`. Use `composition.yaml` when structured package
328
+ metadata is useful for validation, automation, or comparison.
329
+
330
+ Reusable package definitions should stay independent from project-specific
331
+ package selection.
332
+
333
+ See `002_project-composition.md` for detailed rules on how root project
334
+ specification files combine packages.
335
+
336
+ ## Directory-scoped specifications
337
+
338
+ A repository directory may have its own `.macrostates/specs/main.md` to define
339
+ what must be implemented inside that directory. These specifications are
340
+ specific to the repository and depend on its enclosing project composition. They
341
+ are not a reusable specification package or an independent project composition
342
+ merely because they live in a `.macrostates/specs/` directory.
343
+
344
+ They do not require a package identity, `package.yaml`, independent package
345
+ version, release tag or local composition manifest. Their authority comes from
346
+ the directory specification contract, not package metadata. See
347
+ [Directory-scoped specifications](002_project-composition.md#directory-scoped-specifications)
348
+ for entrypoint, boundary, discovery and authority rules.