runtimeconditions-profiler 0.5.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 (47) hide show
  1. runtimeconditions_profiler-0.5.0/.github/workflows/release.yml +210 -0
  2. runtimeconditions_profiler-0.5.0/.github/workflows/test.yml +41 -0
  3. runtimeconditions_profiler-0.5.0/.gitignore +8 -0
  4. runtimeconditions_profiler-0.5.0/CONFORMANCE.md +201 -0
  5. runtimeconditions_profiler-0.5.0/GENERATED-BINDINGS-INTEROP-PLAN.md +93 -0
  6. runtimeconditions_profiler-0.5.0/LICENSE +21 -0
  7. runtimeconditions_profiler-0.5.0/MANIFEST.in +9 -0
  8. runtimeconditions_profiler-0.5.0/PKG-INFO +314 -0
  9. runtimeconditions_profiler-0.5.0/README.md +298 -0
  10. runtimeconditions_profiler-0.5.0/pyproject.toml +40 -0
  11. runtimeconditions_profiler-0.5.0/requirements/release.txt +4 -0
  12. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/__init__.py +2 -0
  13. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/cli.py +128 -0
  14. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/constants.py +1 -0
  15. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/errors.py +3 -0
  16. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/extension/__init__.py +0 -0
  17. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/extension/identity.py +51 -0
  18. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/profile/__init__.py +3 -0
  19. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/profile/generated.py +314 -0
  20. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/profile/semantic.py +373 -0
  21. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/profile/static_values.py +329 -0
  22. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/profile/writer.py +22 -0
  23. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/project/__init__.py +3 -0
  24. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/project/installed.py +236 -0
  25. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/project/verify.py +600 -0
  26. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/runtimeconditions.profile.v0.4.0.schema.yaml +94 -0
  27. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/schemas.json +2831 -0
  28. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/source/__init__.py +5 -0
  29. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/source/python.py +41 -0
  30. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler/yamlio.py +49 -0
  31. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler.egg-info/PKG-INFO +314 -0
  32. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler.egg-info/SOURCES.txt +45 -0
  33. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler.egg-info/dependency_links.txt +1 -0
  34. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler.egg-info/entry_points.txt +2 -0
  35. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler.egg-info/requires.txt +8 -0
  36. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler.egg-info/scm_file_list.json +42 -0
  37. runtimeconditions_profiler-0.5.0/runtimeconditions_profiler.egg-info/top_level.txt +1 -0
  38. runtimeconditions_profiler-0.5.0/scripts/check_distributions.py +196 -0
  39. runtimeconditions_profiler-0.5.0/scripts/release_artifacts.py +202 -0
  40. runtimeconditions_profiler-0.5.0/scripts/smoke_install.py +123 -0
  41. runtimeconditions_profiler-0.5.0/setup.cfg +4 -0
  42. runtimeconditions_profiler-0.5.0/tests/test_distribution_contents.py +146 -0
  43. runtimeconditions_profiler-0.5.0/tests/test_extension_identity.py +54 -0
  44. runtimeconditions_profiler-0.5.0/tests/test_generated_binding_extraction.py +236 -0
  45. runtimeconditions_profiler-0.5.0/tests/test_installed_binding_discovery.py +977 -0
  46. runtimeconditions_profiler-0.5.0/tests/test_release_artifacts.py +266 -0
  47. runtimeconditions_profiler-0.5.0/tests/test_release_smoke.py +49 -0
@@ -0,0 +1,210 @@
1
+ name: Tagged Python release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+ inputs:
9
+ mode:
10
+ description: Manual workflow mode
11
+ type: choice
12
+ required: true
13
+ default: build-and-test
14
+ options:
15
+ - build-and-test
16
+ - promote-pypi
17
+ release_tag:
18
+ description: 'Version tag for branch builds (e.g. v0.0.1); leave empty when running at a tag. No Git tag is created.'
19
+ type: string
20
+ required: false
21
+
22
+ permissions:
23
+ contents: read
24
+
25
+ concurrency:
26
+ group: python-release-${{ github.ref }}-${{ inputs.mode == 'build-and-test' && 'validation' || 'release' }}
27
+ cancel-in-progress: false
28
+
29
+ jobs:
30
+ build:
31
+ if: >-
32
+ ${{ github.event_name == 'push' ||
33
+ (github.event_name == 'workflow_dispatch' && inputs.mode == 'build-and-test') }}
34
+ runs-on: ubuntu-24.04
35
+ timeout-minutes: 15
36
+ outputs:
37
+ version: ${{ steps.tag.outputs.version }}
38
+ prerelease: ${{ steps.tag.outputs.prerelease }}
39
+ steps:
40
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
41
+ with:
42
+ ref: ${{ github.sha }}
43
+ persist-credentials: false
44
+ - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
45
+ with:
46
+ python-version: '3.12'
47
+ - name: Install release tools
48
+ run: python -m pip install --disable-pip-version-check -r requirements/release.txt
49
+ - name: Resolve package version from release tag
50
+ id: tag
51
+ env:
52
+ INPUT_RELEASE_TAG: ${{ inputs.release_tag }}
53
+ REF_TYPE: ${{ github.ref_type }}
54
+ REF_NAME: ${{ github.ref_name }}
55
+ run: |
56
+ if [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" && -n "$INPUT_RELEASE_TAG" ]]; then
57
+ RELEASE_TAG="$INPUT_RELEASE_TAG"
58
+ elif [[ "$REF_TYPE" == "tag" ]]; then
59
+ RELEASE_TAG="$REF_NAME"
60
+ else
61
+ echo "Manual branch builds require release_tag, for example v0.0.1. No Git tag needs to exist." >&2
62
+ exit 1
63
+ fi
64
+ python scripts/release_artifacts.py check-tag "$RELEASE_TAG" --github-output "$GITHUB_OUTPUT"
65
+ - name: Build release distributions once
66
+ env:
67
+ SETUPTOOLS_SCM_PRETEND_VERSION_FOR_RUNTIMECONDITIONS_PROFILER: ${{ steps.tag.outputs.version }}
68
+ run: python -m build
69
+ - name: Validate metadata and distribution contents
70
+ env:
71
+ RELEASE_VERSION: ${{ steps.tag.outputs.version }}
72
+ run: |
73
+ python -m twine check --strict dist/*.whl dist/*.tar.gz
74
+ mkdir -p release-evidence
75
+ python scripts/check_distributions.py dist/*.whl dist/*.tar.gz --expected-version "$RELEASE_VERSION" > release-evidence/contents.json
76
+ python scripts/release_artifacts.py checksums --dist-dir dist
77
+ - name: Run self-contained regression tests
78
+ run: |
79
+ wheel=(dist/*.whl)
80
+ python -m pip install "${wheel[0]}[test]"
81
+ python -m pytest -q
82
+ - name: Preserve exact release distributions
83
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
84
+ with:
85
+ name: release-distributions
86
+ path: |
87
+ dist/*.whl
88
+ dist/*.tar.gz
89
+ dist/SHA256SUMS
90
+ if-no-files-found: error
91
+ retention-days: 30
92
+ - name: Preserve distribution validation evidence
93
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
94
+ with:
95
+ name: distribution-evidence
96
+ path: release-evidence/
97
+ if-no-files-found: error
98
+
99
+ smoke:
100
+ needs: build
101
+ strategy:
102
+ fail-fast: false
103
+ matrix:
104
+ os: [ubuntu-24.04]
105
+ python: ['3.11', '3.12', '3.13', '3.14']
106
+ include:
107
+ - os: macos-15
108
+ python: '3.12'
109
+ - os: windows-2022
110
+ python: '3.12'
111
+ runs-on: ${{ matrix.os }}
112
+ timeout-minutes: 20
113
+ steps:
114
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
115
+ with:
116
+ ref: ${{ github.sha }}
117
+ persist-credentials: false
118
+ - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
119
+ with:
120
+ python-version: ${{ matrix.python }}
121
+ - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
122
+ with:
123
+ name: release-distributions
124
+ path: dist
125
+ - name: Install and smoke-check both exact artifacts
126
+ shell: bash
127
+ env:
128
+ RELEASE_VERSION: ${{ needs.build.outputs.version }}
129
+ run: python scripts/smoke_install.py --dist-dir dist --report release-evidence/smoke.json --expected-version "$RELEASE_VERSION"
130
+ - name: Preserve installed-package evidence
131
+ if: always()
132
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
133
+ with:
134
+ name: smoke-${{ matrix.os }}-python-${{ matrix.python }}
135
+ path: release-evidence/
136
+ if-no-files-found: warn
137
+
138
+ release:
139
+ needs: [build, smoke]
140
+ if: github.event_name == 'push' && github.ref_type == 'tag'
141
+ runs-on: ubuntu-24.04
142
+ timeout-minutes: 10
143
+ permissions:
144
+ contents: write
145
+ steps:
146
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
147
+ with:
148
+ ref: ${{ github.sha }}
149
+ persist-credentials: false
150
+ - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
151
+ with:
152
+ name: release-distributions
153
+ path: dist
154
+ - name: Attach verified assets and publish the GitHub Release
155
+ env:
156
+ GH_TOKEN: ${{ github.token }}
157
+ RELEASE_TAG: ${{ github.ref_name }}
158
+ RELEASE_COMMIT: ${{ github.sha }}
159
+ IS_PRERELEASE: ${{ needs.build.outputs.prerelease }}
160
+ run: |
161
+ args=()
162
+ if [[ "$IS_PRERELEASE" == "true" ]]; then
163
+ args+=(--prerelease)
164
+ fi
165
+ python3 scripts/release_artifacts.py publish --dist-dir dist \
166
+ --repository "$GITHUB_REPOSITORY" --tag "$RELEASE_TAG" \
167
+ --commit "$RELEASE_COMMIT" "${args[@]}"
168
+
169
+ pypi:
170
+ needs: release
171
+ if: >-
172
+ ${{ !cancelled() && vars.PYPI_PUBLISH_ENABLED == 'true' &&
173
+ github.ref_type == 'tag' &&
174
+ ((github.event_name == 'push' && needs.release.result == 'success') ||
175
+ (github.event_name == 'workflow_dispatch' && inputs.mode == 'promote-pypi' &&
176
+ needs.release.result == 'skipped')) }}
177
+ runs-on: ubuntu-24.04
178
+ timeout-minutes: 10
179
+ environment:
180
+ name: pypi
181
+ url: https://pypi.org/p/runtimeconditions-profiler
182
+ permissions:
183
+ contents: read
184
+ id-token: write
185
+ steps:
186
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
187
+ with:
188
+ ref: ${{ github.sha }}
189
+ persist-credentials: false
190
+ - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
191
+ with:
192
+ python-version: '3.12'
193
+ - name: Install artifact validation dependency
194
+ run: python -m pip install --disable-pip-version-check packaging==26.3
195
+ - name: Download and verify the published GitHub Release assets
196
+ env:
197
+ GH_TOKEN: ${{ github.token }}
198
+ RELEASE_TAG: ${{ github.ref_name }}
199
+ RELEASE_COMMIT: ${{ github.sha }}
200
+ run: |
201
+ python scripts/release_artifacts.py prepare-pypi \
202
+ --repository "$GITHUB_REPOSITORY" --tag "$RELEASE_TAG" \
203
+ --commit "$RELEASE_COMMIT" --dist-dir release-assets \
204
+ --packages-dir pypi-dist
205
+ - name: Publish the exact verified distributions to PyPI
206
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
207
+ with:
208
+ packages-dir: pypi-dist/
209
+ attestations: true
210
+ print-hash: true
@@ -0,0 +1,41 @@
1
+ name: Test
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ concurrency:
14
+ group: python-tests-${{ github.event.pull_request.number || github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ jobs:
18
+ test:
19
+ name: Python ${{ matrix.python }}
20
+ runs-on: ubuntu-24.04
21
+ timeout-minutes: 15
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ python: ['3.11', '3.12', '3.13', '3.14']
26
+ steps:
27
+ - name: Check out profiler
28
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29
+ with:
30
+ fetch-depth: 0
31
+ persist-credentials: false
32
+ - name: Set up Python
33
+ uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
34
+ with:
35
+ python-version: ${{ matrix.python }}
36
+ cache: pip
37
+ cache-dependency-path: pyproject.toml
38
+ - name: Install profiler and test dependencies
39
+ run: python -m pip install --disable-pip-version-check '.[test]'
40
+ - name: Run all tests
41
+ run: python -m pytest -q -ra
@@ -0,0 +1,8 @@
1
+ .DS_Store
2
+ .venv/
3
+ .pytest_cache/
4
+ __pycache__/
5
+ *.pyc
6
+ *.egg-info/
7
+ build/
8
+ dist/
@@ -0,0 +1,201 @@
1
+ # Python profiler Phase 4 conformance
2
+
3
+ **Result (2026-10-04): accepted in the tested local scope.** The separately
4
+ installed Python profiler passed **19 positive** and **six negative** official
5
+ consumer workloads, then **29 supplemental** trust-chain and execution-boundary
6
+ checks: **54 passed, zero failed, zero pending**. The
7
+ [consolidated Phase 4 review](../phase4-dependency-schema-review-20261004/consolidated-review.yaml)
8
+ accepts all applicable Section 13 gates (**1–14 and 16**) across the 14 Python
9
+ distributions and 14 Go modules. The [Phase 4 summary](../extensions/tooling/extension-bindings/PHASE-4.md)
10
+ records the shared package-generation checks. This report explains the Python
11
+ profiler's installed CLI evidence and the limits of that result.
12
+
13
+ ## Contract and installed boundary
14
+
15
+ | Piece | Role |
16
+ | --- | --- |
17
+ | [Implementation contract](../extensions/tooling/extension-bindings/IMPLEMENTATION.md) | Section 11 defines the structural manifest and four fixed package resources; Section 13 defines verification gates and the Phase 4 exit criteria. |
18
+ | [Approved core profile schema](../spec/schema/runtimeconditions.profile.v0.1.0.schema.yaml) | Included in the profiler wheel. The installed CLI checks its identity and digest and validates each complete profile without reading the schema checkout. |
19
+ | [Installed binding discovery](runtimeconditions_profiler/project/installed.py) | Parse workload imports, map import packages to installed distributions through Python metadata, and read the four fixed resources without importing binding or application code. |
20
+ | [Binding verification](runtimeconditions_profiler/project/verify.py) | Validate resource schemas, distribution ownership, package and extension identities, versions, semantic digests, release provenance, dependency locks, and exact extension closure. |
21
+ | [Structural extraction](runtimeconditions_profiler/profile/generated.py) | Reconstruct generated declaration calls statically from verified manifest coordinates, including optional values, enums, collections, maps, unions, aliases, exact serialized names, and cross-module references. Unresolved recognized calls fail at their source location. |
22
+ | [Profile validation](runtimeconditions_profiler/profile/semantic.py) | Apply the bundled core schema, vocabulary ownership rules, and every applicable Draft 2020-12 extension schema in the full verified closure. Emit only directly contributing extension IDs and write only after validation succeeds. |
23
+
24
+ The workload imports installed binding distributions by their normal Python
25
+ module names. The profiler wheel and those distributions are installed in the
26
+ same environment through `pip`. The profiler receives no `extensions` source
27
+ checkout, local extension-definition path, editable installation, or
28
+ checkout-based `PYTHONPATH`. Each binding distribution provides
29
+ `runtimeconditions.bindings.yaml`, `runtimeconditions.binding-model.yaml`,
30
+ `runtimeconditions.extension.yaml`, and
31
+ `runtimeconditions.binding-release.yaml` beside its installed import package.
32
+ The CLI reads their bytes through distribution file records; it does not
33
+ execute package initialization to discover them.
34
+
35
+ ## Reviewed consumer corpus
36
+
37
+ The [reviewed catalog](../extensions/tooling/extension-bindings/fixtures/conformance.yaml)
38
+ defines complete Conditions, direct contributors, positive declarations, and
39
+ negative constraints independently of profiler output. The official
40
+ [v4 assembly](../phase4-dependency-schema-fixtures-v4-20261004/) contains
41
+ **14 test-only Python wheels** from ten positive cases. The
42
+ [v4 prepared inventory](../phase4-dependency-schema-results-v4-20261004/inventory.yaml)
43
+ has **19 positive** and **six negative** Python workloads. Its workloads cover
44
+ all **13 emitted calls** plus **two completed deferred declarations**. The
45
+ leaf and middle consumers supply the core-required `interface` through
46
+ installed dependency bindings, so every counted positive is a complete
47
+ profile rather than a successful rejection.
48
+
49
+ Each ID below has `python/workloads/<ID>/app.py` and pinned
50
+ `requirements.txt` under the prepared result tree. A positive has a complete
51
+ `python/expected/<ID>.yaml`; a negative has an exact
52
+ `python/expected/<ID>.error.yaml`. The inventory records source and oracle
53
+ hashes, commands, direct contributors, and full closure.
54
+
55
+ | Source case | Positive profile workload IDs | Negative workload IDs | Main check |
56
+ | --- | --- | --- | --- |
57
+ | `01-owned-kind-interface` | `owned` | — | Owned kind, interface, and field |
58
+ | `02-additive-field` | `additive-owner`, `additive-consumer` | — | Direct additive ownership |
59
+ | `03-transitive-closure` | `transitive-leaf-consumer`, `transitive-middle-consumer`, `transitive-root-consumer` | — | Complete declarations and transitive dependencies |
60
+ | `06-recursive-reference` | `recursive` | — | Recursive object and required values |
61
+ | `07-object-alternatives` | `alternatives-command`, `alternatives-image` | `alternatives-missing`, `alternatives-both` | Branch-dependent `oneOf` |
62
+ | `08-heterogeneous-union` | `union-object`, `union-string` | `union-missing-id` | Object and scalar union variants |
63
+ | `09-collections-and-maps` | `collections`, `collection-second-value` | `collection-invalid-value` | Arrays, maps, and allowed numbers |
64
+ | `10-scoped-domains-collisions` | `scoped-grpc`, `scoped-http`, `scoped-http-proxy`, `scoped-optional-omitted` | `scoped-invalid-value` | Scoped values, collisions, optional omission |
65
+ | `11-source-name-preservation` | `source-names` | — | Exact serialized names, including Unicode |
66
+ | `13-dependency-schema-only` | `dependency-schema-only` | `dependency-schema-invalid` | Validation-only dependency |
67
+
68
+ The three normalizer negatives, `04-dependency-cycle`,
69
+ `05-vocabulary-conflict`, and `12-unsupported-structural-keyword`, have
70
+ separate exact diagnostics under the [shared cases](../extensions/tooling/extension-bindings/model/conformance/cases/).
71
+ They produce no Python binding wheels and are covered by the shared gate
72
+ review, not counted among the six installed-profiler negatives.
73
+
74
+ Case 13 tests a distinction that the earlier corpus lacked. Its root owns
75
+ `job`, `process`, and `command`; its dependency owns **no vocabulary** and
76
+ provides the sole `command-limit` schema (`maxLength: 6`). The positive
77
+ profile lists only the root ID, while `verify-bindings` finds both root and
78
+ dependency in the closure. The negative's `too-long` value passes the other
79
+ applicable schemas but fails that dependency schema at the recorded `schema`
80
+ stage. The exact normalized diagnostic names the dependency schema, and no
81
+ profile is written. The [YAML result](../python-profiler-dependency-schema-acceptance-final-20261004/summary.yaml)
82
+ records the direct IDs, closure, coordinate, hashes, and failure result.
83
+
84
+ ## Installed CLI acceptance
85
+
86
+ The external [acceptance runner](../python-profiler-cli-acceptance/run_phase4_acceptance.py)
87
+ served the tested profiler wheel and binding wheels from a temporary PEP 503
88
+ HTTP package index. It created isolated Python environments, installed the
89
+ profiler and binding distributions **by name and version** through `pip`, and
90
+ checked the `pip --report` URLs for HTTP retrieval. It removed ambient
91
+ `PYTHONPATH`, `PYTHONHOME`, virtual-environment, and `PIP_` settings from the
92
+ profiler runtime environment. The workload sources use absolute imports from
93
+ those installed distributions; they contain a sentinel that raises if
94
+ executed. The installed `runtimeconditions-python-profiler` console script,
95
+ not source code from this repository, ran `profile verify-bindings` and
96
+ `profile generate` for every case.
97
+
98
+ | Check | Final result |
99
+ | --- | --- |
100
+ | Positive profiles | **19/19** successful; full YAML matches the independently reviewed bytes and repeats identically. Emitted extension IDs match direct contributors. |
101
+ | Negative declarations | **6/6** have the expected failure stage and exact stderr after replacing the absolute workload path with `<workload>`; each exits nonzero and leaves no output. |
102
+ | Installed identities and closure | All **14** wheels, their four fixed resources, release provenance, installed distribution identities and versions, and every workload's full extension closure match the prepared inventory. |
103
+ | Schema-only dependency | Direct contributors are a proper subset of closure; the negative specifically names the omitted dependency's `command-limit` schema. |
104
+ | Supplemental suite | **29/29** checks pass: 16 profiles and 13 expected rejections covering altered or absent resources, wrong identities and digests, missing dependencies, dynamic source, and code-execution boundaries. |
105
+ | Regression suite | `86 passed` after the scoped-enum correction; no later profiler source change was needed for case 13. |
106
+
107
+ The supplemental [runner](../python-profiler-cli-acceptance/run_acceptance.py)
108
+ also installs a modified wheel whose package initialization raises and profiles
109
+ a workload that raises if executed. It still produces the exact expected
110
+ profile, demonstrating static operation. Its other negatives exercise the
111
+ trust chain and expression boundary beyond the six official declarations.
112
+
113
+ The installed run used **Python 3.12.10** and profiler wheel SHA-256
114
+ `1a845ba0edd27eb02d877b7acd001878cf5b587b3fba36143eb7b6dfd19abbf6`.
115
+ The approved core schema source SHA-256 is
116
+ `ad101336b676b468ec975aff45c21749df22fddf422371156c586ed62abf3223`.
117
+ The profiler wheel supplies that schema; no source checkout is a runtime
118
+ input. The [artifact manifest](../python-profiler-dependency-schema-acceptance-final-20261004/artifact-manifest.json)
119
+ records the runner, wheel, resource, tool, oracle, and result hashes.
120
+
121
+ ## Evidence and repeatable commands
122
+
123
+ The definitive [machine-readable YAML summary](../python-profiler-dependency-schema-acceptance-final-20261004/summary.yaml)
124
+ reports **54 passed, zero failed, zero pending**. The
125
+ [official details](../python-profiler-dependency-schema-acceptance-final-20261004/official/results.json)
126
+ and [supplemental details](../python-profiler-dependency-schema-acceptance-final-20261004/supplemental/results.json)
127
+ retain commands, exits, exact diagnostics, profile hashes, verified closures,
128
+ wheel hashes, and Python version. The evidence directory also contains actual
129
+ and repeated profiles, six normalized diagnostic files, copied inventory and
130
+ catalog, and `pip` installation reports. The
131
+ [durable bundle](../python-profiler-dependency-schema-acceptance-bundle-20261004.tar.gz)
132
+ preserves those results, the runner, wheels, prepared workloads, reviewed
133
+ expectations, and tool hashes without disposable virtual environments or
134
+ HTTP-index copies. Its companion `.sha256` file verifies the archive.
135
+
136
+ The exact final installed CLI command was run from the external
137
+ `python-profiler-cli-acceptance` directory:
138
+
139
+ ```sh
140
+ cd /Users/colacy/code/github.com/runtimeconditions/python-profiler-cli-acceptance
141
+ python3 run_phase4_acceptance.py \
142
+ --inventory /Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-results-20261004/inventory.yaml \
143
+ --catalog /Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/fixtures/conformance.yaml \
144
+ --profiler-wheel /Users/colacy/code/github.com/runtimeconditions/python-profiler-phase4-build-20261004-v2/wheels/runtimeconditions_profiler-0.1.0-py3-none-any.whl \
145
+ --binding-wheel-dir /Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-fixtures-v3-20261004/python/wheels \
146
+ --supplemental-binding-wheel-dir /Users/colacy/code/github.com/runtimeconditions/python-profiler-cli-acceptance-evidence/inputs/bindings \
147
+ --output /Users/colacy/code/github.com/runtimeconditions/python-profiler-dependency-schema-acceptance-final-20261004 \
148
+ --pypi-dependencies
149
+ ```
150
+
151
+ For a repeat run, choose a new empty output directory. The
152
+ [fixture README](../extensions/tooling/extension-bindings/fixtures/README.md)
153
+ documents the official assembler and preparer commands and pinned build
154
+ tools. Their `inventory.yaml` is labeled
155
+ `prepared-awaiting-installed-cli-acceptance` because preparation does not
156
+ invoke a profiler; the separate installed CLI result above records the actual
157
+ acceptance. The regression command was:
158
+
159
+ ```sh
160
+ cd /Users/colacy/code/github.com/runtimeconditions/python-rc-profiler
161
+ /private/tmp/rc-profiler-step3-venv/bin/python -m pytest -q
162
+ ```
163
+
164
+ It reported `86 passed`. This test command uses profiler source for regression
165
+ checks; the installed CLI acceptance command uses only the built wheel.
166
+
167
+ ## Evidence provenance and final decision
168
+
169
+ | Evidence | Result and contribution |
170
+ | --- | --- |
171
+ | [2026-10-03 external suite](../python-profiler-cli-acceptance-evidence/results.json) | **29/29** passed: 16 exact profiles and 13 expected rejections. It covered 12 generated positive calls; bare transitive leaf and middle calls lacked the core-required `interface` and therefore could not establish the complete positive-profile gate. Its input wheels and command are preserved with the evidence. |
172
+ | [First 18+5 attempt](../python-profiler-phase4-acceptance-20261004/official/results.json) | The supplied profiler wheel stopped at `union-missing-id`: it predated the union fallback already present in current source. The failure command and diagnostic were retained; no oracle was changed. |
173
+ | [Rebuilt intermediate attempt](../python-profiler-phase4-acceptance-rebuilt-20261004/official/results.json) | **22/23** official cases passed. `scoped-invalid-value` exposed a wrong-scope verified enum member rejected structurally before vocabulary validation. The profiler was corrected to let that negative reach vocabulary validation while rejecting structural fallback for a valid profile; the regression suite reached 86 tests. |
174
+ | [Complete 18+5 run](../python-profiler-phase4-acceptance-final-20261004/summary.json) | **52/52** passed: 18 complete positive profiles, five exact negatives, and all 29 supplemental checks. Its independently reviewed workload and expectation trees matched the supplied ones byte for byte. The [bundle](../python-profiler-phase4-acceptance-bundle-20261004.tar.gz) remains preserved. |
175
+ | [Expanded 19+6 run](../python-profiler-dependency-schema-acceptance-final-20261004/summary.yaml) | **54/54** passed with the schema-only dependency case and matching profiler release provenance. This is the definitive Python installed CLI result. |
176
+
177
+ The later [v4 assembly](../phase4-dependency-schema-fixtures-v4-20261004/)
178
+ was rebuilt for repaired Go profiler provenance. The independent
179
+ [Python v4 equivalence check](../phase4-dependency-schema-review-20261004/python-v4-equivalence.yaml)
180
+ matched **all 14 Python wheel bytes** to the passing installed inputs,
181
+ including **56 fixed resources**; all **50 workload files** and **25 reviewed
182
+ expectation files** were also byte-identical. The Python inventory matched
183
+ after substituting only assembly and result paths. The unchanged 54/54
184
+ Python run therefore applies to the v4 Python inputs without a rerun.
185
+
186
+ The user approved case 13 registration in the normalizer and Go emitter
187
+ regression suites and its reviewed model checkpoint. Python's existing emitter
188
+ suite discovered the new checkpoint automatically and passed **98 tests**;
189
+ the registration changed no Python profiler source or assembled package bytes.
190
+ The [consolidated review](../phase4-dependency-schema-review-20261004/consolidated-review.yaml)
191
+ then accepted all applicable Phase 4 gates across both languages and records
192
+ **no remaining acceptance blocker in the tested local scope**.
193
+
194
+ This acceptance uses test-only fixture assembly and local mock package
195
+ retrieval. It does not establish production publication or distribution,
196
+ broader platform qualification, or live HTTP resolution of extension IDs.
197
+ For end users, binding distributions must be published to a configured Python
198
+ package index; the generated profile's versioned HTTP(S) extension IDs are
199
+ resolved remotely by a consuming Adapter. This profiler currently validates
200
+ the definitions bundled in its installed bindings rather than fetching those
201
+ definitions by URI during generation.
@@ -0,0 +1,93 @@
1
+ # Generated Extension Bindings Interoperability Plan: Python Profiler
2
+
3
+ ## Purpose and acceptance boundary
4
+
5
+ The Python profiler must generate a complete Runtime Conditions Profile from
6
+ Python source that uses automatically generated extension bindings. The
7
+ end-user environment contains an installed profiler wheel/CLI, a Python
8
+ environment with binding distributions installed through dependency management,
9
+ and exact extension definitions available from installed bindings, a verified
10
+ local cache, or supported URI resolution. Normal profiling must not require an
11
+ `extensions` checkout, explicit sibling package paths, an editable install, or
12
+ `python profiler.py` from the profiler source tree.
13
+
14
+ This is a profiler implementation plan, not a change to the extension binding
15
+ generator. The Phase 3 Python API exposes inert declaration functions,
16
+ keyword-only frozen dataclasses, `Sequence` and `dict` aliases, `StrEnum` value
17
+ domains, optional `None` fields, and imported marker protocols. Phase 4 will
18
+ complete the structural binding manifest. The profiler must consume that
19
+ versioned contract without preserving the earlier handwritten mapping as the
20
+ meaning of generated bindings.
21
+
22
+ **Priority:** Correct extraction and complete validation of generated binding
23
+ declarations take precedence over the previous SDK mapping feature. SDK mapping
24
+ discovery or extraction may be disabled, separated, or removed if it conflicts
25
+ with installed-package discovery, static analysis, exact extension identity,
26
+ or fail-closed behavior. The old SDK mapping work is not a compatibility gate
27
+ for generated bindings.
28
+
29
+ ## Current strengths and functional gaps
30
+
31
+ | Area | Current implementation and gap | Required remediation |
32
+ | --- | --- | --- |
33
+ | Installed CLI | `pyproject.toml` defines `runtimeconditions-python-profiler`, but README examples use the source-tree script and explicit sibling package paths. | Build a wheel and install it in an isolated environment. Exercise the console script from an unrelated project with both repositories unavailable. Keep editable installs for development only. |
34
+ | Binding discovery | `project/discovery.py` scans the project and configured package paths recursively. It does not discover generated binding resources by following the workload's installed import-to-distribution mapping. SDK mapping discovery already uses installed distribution metadata, but that is a separate path. | Resolve imported binding packages to installed distributions with native packaging metadata. Locate the fixed package-data resources within only those resolved distributions; do not scan `site-packages` or caches recursively. Read resources without importing or executing the binding package's `__init__.py`. |
35
+ | Binding contract | `manifest/parser.py` and `extension/artifact_validator.py` read the earlier `RuntimeConditionsBinding` mapping. Phase 3 emits `RuntimeConditionsBindingManifest` with a provisional symbol inventory. | Strictly parse the completed structural manifest version and verify its distribution/import-package identity, native symbols, model digest, root extension identity and digest, and relationships against packaged resources. Fail on unknown or inconsistent contract versions. |
36
+ | Source reconstruction | `profile/extractor.py` follows legacy declaration/option mappings and several known targets. It does not reconstruct arbitrary extension-defined fields from generated dataclass construction. | Match generated top-level declaration functions through the resolved import and distribution. Interpret keyword-only dataclass calls, named fields, nested objects, tuples/sequences, lists, dictionaries, `StrEnum` members, union alternatives, optional `None`, and imported marker protocols through manifest-to-model coordinates. Preserve exact serialized source names, including Unicode and collision-resolved Python identifiers. |
37
+ | Static-value boundary | Existing extraction handles selected string constants, calls, and class arguments; other expressions can be skipped or fail under legacy rules. | Define a bounded AST evaluator for literals, supported constructors, enum members, containers, and simple statically provable references across project modules. Never import application or binding code and never use `eval` or `exec`. A recognized declaration with a dynamic or ambiguous value must fail with file, line, column, symbol, and model coordinate. |
38
+ | Validation and identity | `profile/validator.py` checks core markers and selected vocabulary paths, but does not apply every extension JSON Schema to binding-derived Conditions. `PythonExtractionScanner.extension_closure()` places transitive dependencies in the emitted extension list. | Validate complete core profile structure, exact extension identity and dependency closure, ownership of every field and value, and all applicable Draft 2020-12 schemas. Emit only directly contributing extension IDs; resolve transitive dependencies for validation. Reject missing or altered package resources and extension definitions. |
39
+ | Failure behavior | The current project path and artifact scans can make a source checkout appear sufficient. The profiler can produce a profile through a path different from the installed binding's package metadata. | Make the installed distribution and imported symbol authoritative. Reject ambiguous import ownership, absent metadata, resource/digest mismatches, unsupported expressions, and semantic errors before writing output. Do not silently produce an empty or narrower profile for a recognized generated declaration. |
40
+ | SDK mapping interaction | `ProfileExtractor.extract` combines binding and SDK-derived Conditions automatically. | Make the generated-binding path independently testable. Make SDK mapping behavior opt-in or remove it if automatic discovery or merging changes correctness, deterministic output, or failure semantics. |
41
+
42
+ ## Remediation sequence
43
+
44
+ 1. **Freeze the installed-artifact contract.** Define CLI inputs, the mapping
45
+ from source imports to installed distributions, fixed package-data paths,
46
+ cache/URI extension resolution, and manifest/model identity checks. Audit
47
+ reusable parser and validation components without carrying over legacy
48
+ `writes[]` semantics. If a resource API would import the package, use
49
+ distribution file metadata to read the resource bytes statically.
50
+ 2. **Prove packaged discovery.** Install the profiler wheel and generated
51
+ binding wheels, including direct and transitive additive dependencies, in a
52
+ fresh virtual environment. Resolve resources from those distributions with
53
+ no explicit `--package-path` and no repository checkout. Reject coordinate,
54
+ version, digest, and extension-ID mismatches.
55
+ 3. **Implement structural extraction.** Start with one owned declaration and
56
+ nested interface object, then additive fields, omitted optionals, enums,
57
+ collections, maps, recursive shapes, heterogeneous unions, Unicode source
58
+ names, and aliases or direct imports. Use a generic coordinate-driven value
59
+ tree rather than extension-specific branches.
60
+ 4. **Make semantic validation mandatory.** Build a complete YAML profile with
61
+ caller-provided workload identity. Derive direct extension contributors
62
+ from used generated symbols, resolve the transitive closure, and apply every
63
+ matching extension schema. Invalid output must not be written.
64
+ 5. **Stabilize diagnostics and output.** Give deterministic source-located
65
+ errors for dynamic values, missing resources, digest mismatches, ambiguous
66
+ imports, invalid dataclass fields, dependency failures, and schema errors.
67
+ Use stable ordering for files, declarations, extension IDs, and mappings.
68
+ 6. **Decide the SDK path last.** Retain SDK mappings only if they meet the same
69
+ installed-artifact and validation guarantees without affecting generated
70
+ binding extraction.
71
+
72
+ ## Evidence required before declaring interoperability
73
+
74
+ - Run the installed console script against an unrelated project in a fresh
75
+ virtual environment containing only the profiler and installed binding
76
+ distributions. The successful invocation uses no editable install, explicit
77
+ sibling package path, or mounted repository checkout.
78
+ - Compare complete profile YAML with reviewed fixtures for every profile-capable
79
+ generated construct, including source and installed-wheel dependency cases.
80
+ Structural type-coverage fixtures that cannot form valid Conditions must
81
+ have explicit expected rejection.
82
+ - Show exact failures for malformed manifests, missing package data, altered
83
+ digests, unresolved extension definitions, unsupported dynamic expressions,
84
+ and each branch-dependent schema constraint.
85
+ - Verify that unused installed or imported bindings contribute no extension
86
+ IDs, transitive dependencies are used for validation, and no application or
87
+ binding package code is imported or executed during profiling.
88
+ - Run the installed-artifact workflow on Linux and macOS with the supported
89
+ minimum Python version. Check deterministic output and diagnostics, bounded
90
+ resource use on a representative large model, and no output after failure.
91
+
92
+ Phase 4 integration should use this evidence as the profiler readiness gate;
93
+ source-tree demos and legacy-manifest golden tests alone do not satisfy it.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Runtime Conditions
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,9 @@
1
+ include README.md CONFORMANCE.md
2
+ recursive-include scripts *.py
3
+ recursive-include requirements *.txt
4
+ recursive-include tests *.py
5
+ exclude runtimeconditions_profiler/runtimeconditions.profile.v0.1.0.schema.yaml
6
+ prune archive
7
+ prune build
8
+ prune dist
9
+ global-exclude __pycache__ *.py[cod] .DS_Store