pgc-workloads 2.0.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.
- pgc_workloads-2.0.0/LICENSE +67 -0
- pgc_workloads-2.0.0/NOTICE +11 -0
- pgc_workloads-2.0.0/PKG-INFO +131 -0
- pgc_workloads-2.0.0/README.md +109 -0
- pgc_workloads-2.0.0/pgc_workloads.egg-info/PKG-INFO +131 -0
- pgc_workloads-2.0.0/pgc_workloads.egg-info/SOURCES.txt +49 -0
- pgc_workloads-2.0.0/pgc_workloads.egg-info/dependency_links.txt +1 -0
- pgc_workloads-2.0.0/pgc_workloads.egg-info/requires.txt +1 -0
- pgc_workloads-2.0.0/pgc_workloads.egg-info/top_level.txt +1 -0
- pgc_workloads-2.0.0/pyproject.toml +48 -0
- pgc_workloads-2.0.0/setup.cfg +4 -0
- pgc_workloads-2.0.0/workloads/__init__.py +0 -0
- pgc_workloads-2.0.0/workloads/collatz/__init__.py +0 -0
- pgc_workloads-2.0.0/workloads/collatz/client/bindings/http.json +6 -0
- pgc_workloads-2.0.0/workloads/collatz/implementation/__init__.py +0 -0
- pgc_workloads-2.0.0/workloads/collatz/implementation/capability_transforms/__init__.py +0 -0
- pgc_workloads-2.0.0/workloads/collatz/implementation/capability_transforms/atoms/__init__.py +0 -0
- pgc_workloads-2.0.0/workloads/collatz/implementation/capability_transforms/atoms/ct_pure_collatz_step_v0.py +67 -0
- pgc_workloads-2.0.0/workloads/collatz/implementation/capability_transforms/atoms/ct_pure_termination_check_v0.py +59 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/behavior_logic/WF_COLLATZ_CONJECTURE_V0/WF_COLLATZ_CONJECTURE_V0.graph.json +209 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/actors/workload__AC_REFERENCE_ACTOR_V0.json +33 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_COMPUTE_SEQUENCES_V0.json +84 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_STORE_RESULTS_V0.json +102 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_VERIFY_TERMINATION_V0.json +96 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/capability_side_effects/capability_side_effects__CS_MUTABLE_JSON_V0.json +439 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/capability_transforms/workload__CT_PURE_COLLATZ_STEP_V0.json +79 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/capability_transforms/workload__CT_PURE_TERMINATION_CHECK_V0.json +87 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/events/workload__EV_CONJECTURE_EVALUATED_V0.json +33 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/ingress_intents/workload__TI_COLLATZ_COMPUTE_V0.json +40 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/intents/workload__IN_COLLATZ_INPUT_VALIDATED_V0.json +47 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/metadata.json +10 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/runtime_bindings/workload__RB_COLLATZ_V0.json +35 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/structures/workload__STRUCTURE_BUILD_WORKLOAD_CONFIG_V0.json +140 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/structures/workload__STRUCTURE_COLLATZ_STORAGE_V0.json +40 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/transport/egress/workload__TE_COLLATZ_COMPUTE_V0.json +50 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/canonical/workflows/workload__WF_COLLATZ_CONJECTURE_V0.json +99 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/evidence/workload/evidence.json +291 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/evidence/workload/evidence_graph.json +1112 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/evidence/workload/metadata.json +16 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/tokenized/workload/dispatch.json +167 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/tokenized/workload/handlers.json +300 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/tokenized/workload/metadata.json +15 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/tokenized/workload/topology.json +158 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/trust/workload/structure_attestation.json +15 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/vocabulary/workload/forward.json +53 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/vocabulary/workload/metadata.json +13 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/compiled/vocabulary/workload/reverse.json +53 -0
- pgc_workloads-2.0.0/workloads/collatz/snapshot/determinations/STRUCTURE_BUILD_WORKLOAD_CONFIG_V0.admitted.json +642 -0
- pgc_workloads-2.0.0/workloads/collatz/test_payloads/01_happy_path.json +3 -0
- pgc_workloads-2.0.0/workloads/collatz/test_payloads/02_single_number.json +3 -0
- pgc_workloads-2.0.0/workloads/collatz/test_payloads/03_invalid_nack.json +3 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026 Bhash Ganti aka Bachi
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
------------------------
|
|
21
|
+
FULL LICENSE TEXT BELOW
|
|
22
|
+
------------------------
|
|
23
|
+
|
|
24
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
25
|
+
|
|
26
|
+
1. Definitions.
|
|
27
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
28
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
29
|
+
"Licensor" shall mean the copyright owner.
|
|
30
|
+
"Legal Entity" shall mean the union of the acting entity and all other
|
|
31
|
+
entities that control, are controlled by, or are under common control.
|
|
32
|
+
"You" shall mean an individual or Legal Entity exercising permissions.
|
|
33
|
+
"Source" form shall mean the preferred form for making modifications.
|
|
34
|
+
"Object" form shall mean any form resulting from mechanical transformation.
|
|
35
|
+
"Work" shall mean the work of authorship.
|
|
36
|
+
"Derivative Works" shall mean any work based on the Work.
|
|
37
|
+
"Contribution" shall mean any work intentionally submitted.
|
|
38
|
+
"Contributor" shall mean Licensor and any individual submitting Contributions.
|
|
39
|
+
|
|
40
|
+
2. Grant of Copyright License.
|
|
41
|
+
Each Contributor grants You a perpetual, worldwide, non-exclusive,
|
|
42
|
+
no-charge, royalty-free copyright license.
|
|
43
|
+
|
|
44
|
+
3. Grant of Patent License.
|
|
45
|
+
Each Contributor grants a patent license to make, use, sell, etc.
|
|
46
|
+
|
|
47
|
+
4. Redistribution.
|
|
48
|
+
You may reproduce and distribute copies provided that:
|
|
49
|
+
- You include a copy of this License
|
|
50
|
+
- You retain notices
|
|
51
|
+
- You state modifications
|
|
52
|
+
- You include NOTICE file if present
|
|
53
|
+
|
|
54
|
+
5. Submission of Contributions.
|
|
55
|
+
Contributions are under this License unless stated otherwise.
|
|
56
|
+
|
|
57
|
+
6. Trademarks.
|
|
58
|
+
This License does not grant trademark rights.
|
|
59
|
+
|
|
60
|
+
7. Disclaimer of Warranty.
|
|
61
|
+
Provided "AS IS", without warranties.
|
|
62
|
+
|
|
63
|
+
8. Limitation of Liability.
|
|
64
|
+
No liability for damages.
|
|
65
|
+
|
|
66
|
+
9. Accepting Warranty or Additional Liability.
|
|
67
|
+
You may offer support/warranty on your own behalf only.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
PGS — Protocol-Governed Systems
|
|
2
|
+
Copyright 2026 Bhash Ganti aka Bachi
|
|
3
|
+
|
|
4
|
+
This project introduces a protocol-first execution model in which:
|
|
5
|
+
|
|
6
|
+
- Behavior is declared in protocol artifacts
|
|
7
|
+
- Execution is performed by a deterministic runtime
|
|
8
|
+
- Capability implementations are bound at compile time
|
|
9
|
+
- Governance is enforced through invariants and assertions
|
|
10
|
+
|
|
11
|
+
Extensibility is achieved by declaration, not refactor.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pgc-workloads
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: PGC conformance workloads — the capability implementations a sealed snapshot binds to make conformance observable
|
|
5
|
+
Author-email: Bhash Ganti <bachipeachy@gmail.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://omnibachi.org/
|
|
8
|
+
Project-URL: Repository, https://github.com/protocol-governed-computing/conformance_workloads
|
|
9
|
+
Project-URL: Standard, https://doi.org/10.5281/zenodo.22150616
|
|
10
|
+
Keywords: protocol-governed-computing,pgc,conformance,workload,collatz
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Topic :: Software Development :: Testing
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
License-File: NOTICE
|
|
20
|
+
Requires-Dist: pgc-runtime>=2.0.0
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# conformance_workloads
|
|
24
|
+
|
|
25
|
+
**The workloads that prove a Profiled Normative Platform conforms.**
|
|
26
|
+
|
|
27
|
+
A *platform* is not a repository — it is a composition. A **Profiled Normative Platform (PNP)** is
|
|
28
|
+
what you get when a selected governance surface (`software_governance`), a selected set of workloads
|
|
29
|
+
(this repo), and optionally a business domain (`business_domains`) are compiled and assembled
|
|
30
|
+
together. There are as many PNPs as there are conformance profiles.
|
|
31
|
+
|
|
32
|
+
This repo holds the workloads side of that composition: independently-authored domains that exercise
|
|
33
|
+
the governed execution path end to end and make conformance claims observable.
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install pgc-workloads
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This package carries declarations and the implementation modules a sealed
|
|
42
|
+
snapshot binds at execution. It provides no command of its own — the toolchain
|
|
43
|
+
packages read it.
|
|
44
|
+
|
|
45
|
+
## Layout
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
conformance_workloads/
|
|
49
|
+
workloads/
|
|
50
|
+
__init__.py import root — `workloads.<name>.implementation.*`
|
|
51
|
+
collatz/
|
|
52
|
+
registry/ the workload's own governance artifacts (WF/IN/CC/CT/EV/AC/RB/…)
|
|
53
|
+
transport/ TI/TE governed boundary contracts
|
|
54
|
+
implementation/ CT atom implementations (pure functions)
|
|
55
|
+
client/ web client + HTTP binding + composition launcher
|
|
56
|
+
test_payloads/ canonical request payloads
|
|
57
|
+
snapshot/ compiled output (generated)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Self-describing domains
|
|
61
|
+
|
|
62
|
+
A workload is compiled **against** an already-compiled governance surface; the governance surface is
|
|
63
|
+
never edited to admit a workload. Each workload carries its own build manifest
|
|
64
|
+
(`registry/structures/STRUCTURE_BUILD_*_CONFIG_V*.md`) declaring its layers via `domain_subpath` —
|
|
65
|
+
resolved under this repo, not under the governance repo.
|
|
66
|
+
|
|
67
|
+
## Build
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cd ../protocol_compiler
|
|
71
|
+
./compile.sh STRUCTURE_BUILD_PLATFORM_CONFIG_V1 # governance surface first
|
|
72
|
+
./compile_domain.sh ../conformance_workloads/workloads/collatz
|
|
73
|
+
cd ../snapshot_assembler && PGC_SNAPSHOT_PROFILE=REFERENCE_PLATFORM_PROFILE_V1 ./assemble.sh # compose the PNP
|
|
74
|
+
cd ../protocol_runtime && ./run.sh
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Environment provisioning
|
|
78
|
+
|
|
79
|
+
This repo is **deliberately not installed** into the workspace venv. Its import root is
|
|
80
|
+
env-provisioned from the repo root — `protocol_runtime/run.sh` puts it on `PYTHONPATH` by default,
|
|
81
|
+
so CT handler refs resolve as `workloads.collatz.implementation.…`. Override with `PGC_IMPL_ROOTS`.
|
|
82
|
+
|
|
83
|
+
## Serve the client
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
./workloads/collatz/client/serve.sh # http://127.0.0.1:8000
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## The package family
|
|
92
|
+
|
|
93
|
+
| Package | Repository | Role |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| `pgc-compiler` | `protocol_compiler` | declarations → compiled projections |
|
|
96
|
+
| `pgc-assembler` | `snapshot_assembler` | projections → sealed snapshot |
|
|
97
|
+
| `pgc-runtime` | `protocol_runtime` | snapshot → governed execution |
|
|
98
|
+
| `pgc-inspector` | `snapshot_inspector` | snapshot → read-only inspection |
|
|
99
|
+
| `pgc-transformation` | `transformation` | change request → protocol artifacts |
|
|
100
|
+
| `pgc-governance` | `software_governance` | the governance surface and its capability implementations |
|
|
101
|
+
| `pgc-workloads` | `conformance_workloads` | the workloads that make conformance observable |
|
|
102
|
+
| `pgc-domains` | `business_domains` | the business domain implementations the composed snapshot binds |
|
|
103
|
+
|
|
104
|
+
`pip install pgc` brings in the whole family.
|
|
105
|
+
|
|
106
|
+
**Installing the toolchain is one of two steps.** The compiler resolves the governance surface from
|
|
107
|
+
`PGC_PLATFORM_ROOT` — fail-hard, cwd-independent, zero inference — so the *declarations* come from a
|
|
108
|
+
repository you point at, never from a wheel. A registry inside a package would be a second governance
|
|
109
|
+
surface competing with the repository's, and a build could then be governed by a stale copy.
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
git clone https://github.com/protocol-governed-computing/software_governance
|
|
113
|
+
export PGC_PLATFORM_ROOT=$PWD/software_governance
|
|
114
|
+
pgc # reports what is installed and whether the anchor resolves
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`PGC_BUILD_ROOT` (compiled output, keeping the governance repo read-only) and `PGC_DOMAIN_ROOTS`
|
|
118
|
+
(additional domains contributing their own `registry/structures`) are optional.
|
|
119
|
+
|
|
120
|
+
**Versioning.** Two schemes, and the published version follows the second.
|
|
121
|
+
|
|
122
|
+
- **Internal** — each repository's `VERSION` file, a monotonic composition ordinal. PGC versions the
|
|
123
|
+
composition rather than each repo: they release together and the governance closure forces lockstep,
|
|
124
|
+
so the ordinal names which composition a repo belongs to. Development happens on `dev/<N>` and each
|
|
125
|
+
cycle is tagged `release-<N>`. This is not published.
|
|
126
|
+
- **Public** — `PUBLIC_VERSION`, tagged on every component repository. The platform is at **`v2`**.
|
|
127
|
+
|
|
128
|
+
**The published version is the public one: `v2` is `2.0.0`.** The standard the packages implement is a
|
|
129
|
+
separate artifact on its own track and is not this number.
|
|
130
|
+
|
|
131
|
+
The standard these packages implement is published separately: https://doi.org/10.5281/zenodo.22150616
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# conformance_workloads
|
|
2
|
+
|
|
3
|
+
**The workloads that prove a Profiled Normative Platform conforms.**
|
|
4
|
+
|
|
5
|
+
A *platform* is not a repository — it is a composition. A **Profiled Normative Platform (PNP)** is
|
|
6
|
+
what you get when a selected governance surface (`software_governance`), a selected set of workloads
|
|
7
|
+
(this repo), and optionally a business domain (`business_domains`) are compiled and assembled
|
|
8
|
+
together. There are as many PNPs as there are conformance profiles.
|
|
9
|
+
|
|
10
|
+
This repo holds the workloads side of that composition: independently-authored domains that exercise
|
|
11
|
+
the governed execution path end to end and make conformance claims observable.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install pgc-workloads
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This package carries declarations and the implementation modules a sealed
|
|
20
|
+
snapshot binds at execution. It provides no command of its own — the toolchain
|
|
21
|
+
packages read it.
|
|
22
|
+
|
|
23
|
+
## Layout
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
conformance_workloads/
|
|
27
|
+
workloads/
|
|
28
|
+
__init__.py import root — `workloads.<name>.implementation.*`
|
|
29
|
+
collatz/
|
|
30
|
+
registry/ the workload's own governance artifacts (WF/IN/CC/CT/EV/AC/RB/…)
|
|
31
|
+
transport/ TI/TE governed boundary contracts
|
|
32
|
+
implementation/ CT atom implementations (pure functions)
|
|
33
|
+
client/ web client + HTTP binding + composition launcher
|
|
34
|
+
test_payloads/ canonical request payloads
|
|
35
|
+
snapshot/ compiled output (generated)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Self-describing domains
|
|
39
|
+
|
|
40
|
+
A workload is compiled **against** an already-compiled governance surface; the governance surface is
|
|
41
|
+
never edited to admit a workload. Each workload carries its own build manifest
|
|
42
|
+
(`registry/structures/STRUCTURE_BUILD_*_CONFIG_V*.md`) declaring its layers via `domain_subpath` —
|
|
43
|
+
resolved under this repo, not under the governance repo.
|
|
44
|
+
|
|
45
|
+
## Build
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
cd ../protocol_compiler
|
|
49
|
+
./compile.sh STRUCTURE_BUILD_PLATFORM_CONFIG_V1 # governance surface first
|
|
50
|
+
./compile_domain.sh ../conformance_workloads/workloads/collatz
|
|
51
|
+
cd ../snapshot_assembler && PGC_SNAPSHOT_PROFILE=REFERENCE_PLATFORM_PROFILE_V1 ./assemble.sh # compose the PNP
|
|
52
|
+
cd ../protocol_runtime && ./run.sh
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Environment provisioning
|
|
56
|
+
|
|
57
|
+
This repo is **deliberately not installed** into the workspace venv. Its import root is
|
|
58
|
+
env-provisioned from the repo root — `protocol_runtime/run.sh` puts it on `PYTHONPATH` by default,
|
|
59
|
+
so CT handler refs resolve as `workloads.collatz.implementation.…`. Override with `PGC_IMPL_ROOTS`.
|
|
60
|
+
|
|
61
|
+
## Serve the client
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
./workloads/collatz/client/serve.sh # http://127.0.0.1:8000
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## The package family
|
|
70
|
+
|
|
71
|
+
| Package | Repository | Role |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `pgc-compiler` | `protocol_compiler` | declarations → compiled projections |
|
|
74
|
+
| `pgc-assembler` | `snapshot_assembler` | projections → sealed snapshot |
|
|
75
|
+
| `pgc-runtime` | `protocol_runtime` | snapshot → governed execution |
|
|
76
|
+
| `pgc-inspector` | `snapshot_inspector` | snapshot → read-only inspection |
|
|
77
|
+
| `pgc-transformation` | `transformation` | change request → protocol artifacts |
|
|
78
|
+
| `pgc-governance` | `software_governance` | the governance surface and its capability implementations |
|
|
79
|
+
| `pgc-workloads` | `conformance_workloads` | the workloads that make conformance observable |
|
|
80
|
+
| `pgc-domains` | `business_domains` | the business domain implementations the composed snapshot binds |
|
|
81
|
+
|
|
82
|
+
`pip install pgc` brings in the whole family.
|
|
83
|
+
|
|
84
|
+
**Installing the toolchain is one of two steps.** The compiler resolves the governance surface from
|
|
85
|
+
`PGC_PLATFORM_ROOT` — fail-hard, cwd-independent, zero inference — so the *declarations* come from a
|
|
86
|
+
repository you point at, never from a wheel. A registry inside a package would be a second governance
|
|
87
|
+
surface competing with the repository's, and a build could then be governed by a stale copy.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
git clone https://github.com/protocol-governed-computing/software_governance
|
|
91
|
+
export PGC_PLATFORM_ROOT=$PWD/software_governance
|
|
92
|
+
pgc # reports what is installed and whether the anchor resolves
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`PGC_BUILD_ROOT` (compiled output, keeping the governance repo read-only) and `PGC_DOMAIN_ROOTS`
|
|
96
|
+
(additional domains contributing their own `registry/structures`) are optional.
|
|
97
|
+
|
|
98
|
+
**Versioning.** Two schemes, and the published version follows the second.
|
|
99
|
+
|
|
100
|
+
- **Internal** — each repository's `VERSION` file, a monotonic composition ordinal. PGC versions the
|
|
101
|
+
composition rather than each repo: they release together and the governance closure forces lockstep,
|
|
102
|
+
so the ordinal names which composition a repo belongs to. Development happens on `dev/<N>` and each
|
|
103
|
+
cycle is tagged `release-<N>`. This is not published.
|
|
104
|
+
- **Public** — `PUBLIC_VERSION`, tagged on every component repository. The platform is at **`v2`**.
|
|
105
|
+
|
|
106
|
+
**The published version is the public one: `v2` is `2.0.0`.** The standard the packages implement is a
|
|
107
|
+
separate artifact on its own track and is not this number.
|
|
108
|
+
|
|
109
|
+
The standard these packages implement is published separately: https://doi.org/10.5281/zenodo.22150616
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pgc-workloads
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: PGC conformance workloads — the capability implementations a sealed snapshot binds to make conformance observable
|
|
5
|
+
Author-email: Bhash Ganti <bachipeachy@gmail.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://omnibachi.org/
|
|
8
|
+
Project-URL: Repository, https://github.com/protocol-governed-computing/conformance_workloads
|
|
9
|
+
Project-URL: Standard, https://doi.org/10.5281/zenodo.22150616
|
|
10
|
+
Keywords: protocol-governed-computing,pgc,conformance,workload,collatz
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Topic :: Software Development :: Testing
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
License-File: NOTICE
|
|
20
|
+
Requires-Dist: pgc-runtime>=2.0.0
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# conformance_workloads
|
|
24
|
+
|
|
25
|
+
**The workloads that prove a Profiled Normative Platform conforms.**
|
|
26
|
+
|
|
27
|
+
A *platform* is not a repository — it is a composition. A **Profiled Normative Platform (PNP)** is
|
|
28
|
+
what you get when a selected governance surface (`software_governance`), a selected set of workloads
|
|
29
|
+
(this repo), and optionally a business domain (`business_domains`) are compiled and assembled
|
|
30
|
+
together. There are as many PNPs as there are conformance profiles.
|
|
31
|
+
|
|
32
|
+
This repo holds the workloads side of that composition: independently-authored domains that exercise
|
|
33
|
+
the governed execution path end to end and make conformance claims observable.
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install pgc-workloads
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This package carries declarations and the implementation modules a sealed
|
|
42
|
+
snapshot binds at execution. It provides no command of its own — the toolchain
|
|
43
|
+
packages read it.
|
|
44
|
+
|
|
45
|
+
## Layout
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
conformance_workloads/
|
|
49
|
+
workloads/
|
|
50
|
+
__init__.py import root — `workloads.<name>.implementation.*`
|
|
51
|
+
collatz/
|
|
52
|
+
registry/ the workload's own governance artifacts (WF/IN/CC/CT/EV/AC/RB/…)
|
|
53
|
+
transport/ TI/TE governed boundary contracts
|
|
54
|
+
implementation/ CT atom implementations (pure functions)
|
|
55
|
+
client/ web client + HTTP binding + composition launcher
|
|
56
|
+
test_payloads/ canonical request payloads
|
|
57
|
+
snapshot/ compiled output (generated)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Self-describing domains
|
|
61
|
+
|
|
62
|
+
A workload is compiled **against** an already-compiled governance surface; the governance surface is
|
|
63
|
+
never edited to admit a workload. Each workload carries its own build manifest
|
|
64
|
+
(`registry/structures/STRUCTURE_BUILD_*_CONFIG_V*.md`) declaring its layers via `domain_subpath` —
|
|
65
|
+
resolved under this repo, not under the governance repo.
|
|
66
|
+
|
|
67
|
+
## Build
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cd ../protocol_compiler
|
|
71
|
+
./compile.sh STRUCTURE_BUILD_PLATFORM_CONFIG_V1 # governance surface first
|
|
72
|
+
./compile_domain.sh ../conformance_workloads/workloads/collatz
|
|
73
|
+
cd ../snapshot_assembler && PGC_SNAPSHOT_PROFILE=REFERENCE_PLATFORM_PROFILE_V1 ./assemble.sh # compose the PNP
|
|
74
|
+
cd ../protocol_runtime && ./run.sh
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Environment provisioning
|
|
78
|
+
|
|
79
|
+
This repo is **deliberately not installed** into the workspace venv. Its import root is
|
|
80
|
+
env-provisioned from the repo root — `protocol_runtime/run.sh` puts it on `PYTHONPATH` by default,
|
|
81
|
+
so CT handler refs resolve as `workloads.collatz.implementation.…`. Override with `PGC_IMPL_ROOTS`.
|
|
82
|
+
|
|
83
|
+
## Serve the client
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
./workloads/collatz/client/serve.sh # http://127.0.0.1:8000
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## The package family
|
|
92
|
+
|
|
93
|
+
| Package | Repository | Role |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| `pgc-compiler` | `protocol_compiler` | declarations → compiled projections |
|
|
96
|
+
| `pgc-assembler` | `snapshot_assembler` | projections → sealed snapshot |
|
|
97
|
+
| `pgc-runtime` | `protocol_runtime` | snapshot → governed execution |
|
|
98
|
+
| `pgc-inspector` | `snapshot_inspector` | snapshot → read-only inspection |
|
|
99
|
+
| `pgc-transformation` | `transformation` | change request → protocol artifacts |
|
|
100
|
+
| `pgc-governance` | `software_governance` | the governance surface and its capability implementations |
|
|
101
|
+
| `pgc-workloads` | `conformance_workloads` | the workloads that make conformance observable |
|
|
102
|
+
| `pgc-domains` | `business_domains` | the business domain implementations the composed snapshot binds |
|
|
103
|
+
|
|
104
|
+
`pip install pgc` brings in the whole family.
|
|
105
|
+
|
|
106
|
+
**Installing the toolchain is one of two steps.** The compiler resolves the governance surface from
|
|
107
|
+
`PGC_PLATFORM_ROOT` — fail-hard, cwd-independent, zero inference — so the *declarations* come from a
|
|
108
|
+
repository you point at, never from a wheel. A registry inside a package would be a second governance
|
|
109
|
+
surface competing with the repository's, and a build could then be governed by a stale copy.
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
git clone https://github.com/protocol-governed-computing/software_governance
|
|
113
|
+
export PGC_PLATFORM_ROOT=$PWD/software_governance
|
|
114
|
+
pgc # reports what is installed and whether the anchor resolves
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`PGC_BUILD_ROOT` (compiled output, keeping the governance repo read-only) and `PGC_DOMAIN_ROOTS`
|
|
118
|
+
(additional domains contributing their own `registry/structures`) are optional.
|
|
119
|
+
|
|
120
|
+
**Versioning.** Two schemes, and the published version follows the second.
|
|
121
|
+
|
|
122
|
+
- **Internal** — each repository's `VERSION` file, a monotonic composition ordinal. PGC versions the
|
|
123
|
+
composition rather than each repo: they release together and the governance closure forces lockstep,
|
|
124
|
+
so the ordinal names which composition a repo belongs to. Development happens on `dev/<N>` and each
|
|
125
|
+
cycle is tagged `release-<N>`. This is not published.
|
|
126
|
+
- **Public** — `PUBLIC_VERSION`, tagged on every component repository. The platform is at **`v2`**.
|
|
127
|
+
|
|
128
|
+
**The published version is the public one: `v2` is `2.0.0`.** The standard the packages implement is a
|
|
129
|
+
separate artifact on its own track and is not this number.
|
|
130
|
+
|
|
131
|
+
The standard these packages implement is published separately: https://doi.org/10.5281/zenodo.22150616
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
NOTICE
|
|
3
|
+
README.md
|
|
4
|
+
pyproject.toml
|
|
5
|
+
pgc_workloads.egg-info/PKG-INFO
|
|
6
|
+
pgc_workloads.egg-info/SOURCES.txt
|
|
7
|
+
pgc_workloads.egg-info/dependency_links.txt
|
|
8
|
+
pgc_workloads.egg-info/requires.txt
|
|
9
|
+
pgc_workloads.egg-info/top_level.txt
|
|
10
|
+
workloads/__init__.py
|
|
11
|
+
workloads/collatz/__init__.py
|
|
12
|
+
workloads/collatz/client/bindings/http.json
|
|
13
|
+
workloads/collatz/implementation/__init__.py
|
|
14
|
+
workloads/collatz/implementation/capability_transforms/__init__.py
|
|
15
|
+
workloads/collatz/implementation/capability_transforms/atoms/__init__.py
|
|
16
|
+
workloads/collatz/implementation/capability_transforms/atoms/ct_pure_collatz_step_v0.py
|
|
17
|
+
workloads/collatz/implementation/capability_transforms/atoms/ct_pure_termination_check_v0.py
|
|
18
|
+
workloads/collatz/snapshot/compiled/behavior_logic/WF_COLLATZ_CONJECTURE_V0/WF_COLLATZ_CONJECTURE_V0.graph.json
|
|
19
|
+
workloads/collatz/snapshot/compiled/canonical/metadata.json
|
|
20
|
+
workloads/collatz/snapshot/compiled/canonical/actors/workload__AC_REFERENCE_ACTOR_V0.json
|
|
21
|
+
workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_COMPUTE_SEQUENCES_V0.json
|
|
22
|
+
workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_STORE_RESULTS_V0.json
|
|
23
|
+
workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_VERIFY_TERMINATION_V0.json
|
|
24
|
+
workloads/collatz/snapshot/compiled/canonical/capability_side_effects/capability_side_effects__CS_MUTABLE_JSON_V0.json
|
|
25
|
+
workloads/collatz/snapshot/compiled/canonical/capability_transforms/workload__CT_PURE_COLLATZ_STEP_V0.json
|
|
26
|
+
workloads/collatz/snapshot/compiled/canonical/capability_transforms/workload__CT_PURE_TERMINATION_CHECK_V0.json
|
|
27
|
+
workloads/collatz/snapshot/compiled/canonical/events/workload__EV_CONJECTURE_EVALUATED_V0.json
|
|
28
|
+
workloads/collatz/snapshot/compiled/canonical/ingress_intents/workload__TI_COLLATZ_COMPUTE_V0.json
|
|
29
|
+
workloads/collatz/snapshot/compiled/canonical/intents/workload__IN_COLLATZ_INPUT_VALIDATED_V0.json
|
|
30
|
+
workloads/collatz/snapshot/compiled/canonical/runtime_bindings/workload__RB_COLLATZ_V0.json
|
|
31
|
+
workloads/collatz/snapshot/compiled/canonical/structures/workload__STRUCTURE_BUILD_WORKLOAD_CONFIG_V0.json
|
|
32
|
+
workloads/collatz/snapshot/compiled/canonical/structures/workload__STRUCTURE_COLLATZ_STORAGE_V0.json
|
|
33
|
+
workloads/collatz/snapshot/compiled/canonical/transport/egress/workload__TE_COLLATZ_COMPUTE_V0.json
|
|
34
|
+
workloads/collatz/snapshot/compiled/canonical/workflows/workload__WF_COLLATZ_CONJECTURE_V0.json
|
|
35
|
+
workloads/collatz/snapshot/compiled/evidence/workload/evidence.json
|
|
36
|
+
workloads/collatz/snapshot/compiled/evidence/workload/evidence_graph.json
|
|
37
|
+
workloads/collatz/snapshot/compiled/evidence/workload/metadata.json
|
|
38
|
+
workloads/collatz/snapshot/compiled/tokenized/workload/dispatch.json
|
|
39
|
+
workloads/collatz/snapshot/compiled/tokenized/workload/handlers.json
|
|
40
|
+
workloads/collatz/snapshot/compiled/tokenized/workload/metadata.json
|
|
41
|
+
workloads/collatz/snapshot/compiled/tokenized/workload/topology.json
|
|
42
|
+
workloads/collatz/snapshot/compiled/trust/workload/structure_attestation.json
|
|
43
|
+
workloads/collatz/snapshot/compiled/vocabulary/workload/forward.json
|
|
44
|
+
workloads/collatz/snapshot/compiled/vocabulary/workload/metadata.json
|
|
45
|
+
workloads/collatz/snapshot/compiled/vocabulary/workload/reverse.json
|
|
46
|
+
workloads/collatz/snapshot/determinations/STRUCTURE_BUILD_WORKLOAD_CONFIG_V0.admitted.json
|
|
47
|
+
workloads/collatz/test_payloads/01_happy_path.json
|
|
48
|
+
workloads/collatz/test_payloads/02_single_number.json
|
|
49
|
+
workloads/collatz/test_payloads/03_invalid_nack.json
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pgc-runtime>=2.0.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
workloads
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pgc-workloads"
|
|
7
|
+
version = "2.0.0"
|
|
8
|
+
description = "PGC conformance workloads — the capability implementations a sealed snapshot binds to make conformance observable"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
authors = [{ name = "Bhash Ganti", email = "bachipeachy@gmail.com" }]
|
|
13
|
+
|
|
14
|
+
keywords = ["protocol-governed-computing", "pgc", "conformance", "workload", "collatz"]
|
|
15
|
+
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
"Topic :: Software Development :: Testing",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
# The collatz atoms import `runtime.ct_executor` for CTExecutionError — the
|
|
25
|
+
# capability-transform contract lives in the runtime package.
|
|
26
|
+
dependencies = ["pgc-runtime>=2.0.0"]
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Homepage = "https://omnibachi.org/"
|
|
30
|
+
Repository = "https://github.com/protocol-governed-computing/conformance_workloads"
|
|
31
|
+
Standard = "https://doi.org/10.5281/zenodo.22150616"
|
|
32
|
+
|
|
33
|
+
# Only the importable implementation ships. A sealed snapshot binds these by
|
|
34
|
+
# fully qualified module path — `workloads.collatz.implementation.
|
|
35
|
+
# capability_transforms.atoms.ct_pure_collatz_step_v0` — so the top-level name
|
|
36
|
+
# is fixed by snapshots already sealed and cannot be nested under a prefix.
|
|
37
|
+
#
|
|
38
|
+
# The declarations (registry/, test_payloads/, snapshot/determinations/) are not
|
|
39
|
+
# packaged. The compiler resolves the governance surface from PGC_PLATFORM_ROOT
|
|
40
|
+
# and PGC_DOMAIN_ROOTS by design — "fail-hard, cwd-independent, zero inference" —
|
|
41
|
+
# so a registry inside a wheel would be a second governance surface competing
|
|
42
|
+
# with the repository's.
|
|
43
|
+
[tool.setuptools.packages.find]
|
|
44
|
+
where = ["."]
|
|
45
|
+
include = ["workloads*"]
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.package-data]
|
|
48
|
+
"*" = ["*.json"]
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_note": "HTTP External Protocol Binding (Patch 2) — adapter-owned config, promotable to an XB_ artifact. Maps HTTP {method, path} to a stable Operation Identity (never a Workflow Identity).",
|
|
3
|
+
"bindings": [
|
|
4
|
+
{ "method": "POST", "path": "/collatz", "operation": "collatz.compute" }
|
|
5
|
+
]
|
|
6
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CT_PURE_COLLATZ_STEP_V0
|
|
3
|
+
|
|
4
|
+
Pure Capability Transform (Atom)
|
|
5
|
+
|
|
6
|
+
Purpose:
|
|
7
|
+
Compute the full Collatz sequence for each number in the input list.
|
|
8
|
+
|
|
9
|
+
Implementation:
|
|
10
|
+
- Pure iteration: n → n/2 (even), 3n+1 (odd), until reaching 1
|
|
11
|
+
- Entire sequence is captured per number
|
|
12
|
+
- No side effects, no external state
|
|
13
|
+
|
|
14
|
+
Purity Class: ct_pure
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from typing import Dict, Any, List
|
|
18
|
+
|
|
19
|
+
from runtime.ct_executor import CTExecutionError
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def execute(inputs: Dict[str, Any], context: Any = None) -> Dict[str, Any]:
|
|
23
|
+
"""
|
|
24
|
+
Execute CT_PURE_COLLATZ_STEP_V0.
|
|
25
|
+
|
|
26
|
+
Inputs:
|
|
27
|
+
numbers (list[int]): List of positive integers for which to compute sequences
|
|
28
|
+
|
|
29
|
+
Outputs:
|
|
30
|
+
sequences (dict): Mapping from str(n) → list of integers (full Collatz sequence)
|
|
31
|
+
"""
|
|
32
|
+
if "numbers" not in inputs:
|
|
33
|
+
raise CTExecutionError(
|
|
34
|
+
"CT_PURE_COLLATZ_STEP_V0: missing required input 'numbers'"
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
numbers = inputs["numbers"]
|
|
38
|
+
|
|
39
|
+
if not isinstance(numbers, list):
|
|
40
|
+
raise CTExecutionError(
|
|
41
|
+
f"CT_PURE_COLLATZ_STEP_V0: 'numbers' must be a list, got {type(numbers).__name__}"
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
sequences: Dict[str, List[int]] = {}
|
|
45
|
+
|
|
46
|
+
for n in numbers:
|
|
47
|
+
if not isinstance(n, int) or isinstance(n, bool):
|
|
48
|
+
raise CTExecutionError(
|
|
49
|
+
f"CT_PURE_COLLATZ_STEP_V0: each number must be a positive integer, got {type(n).__name__}"
|
|
50
|
+
)
|
|
51
|
+
if n < 1:
|
|
52
|
+
raise CTExecutionError(
|
|
53
|
+
f"CT_PURE_COLLATZ_STEP_V0: each number must be >= 1, got {n}"
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
seq: List[int] = [n]
|
|
57
|
+
current = n
|
|
58
|
+
while current != 1:
|
|
59
|
+
if current % 2 == 0:
|
|
60
|
+
current = current // 2
|
|
61
|
+
else:
|
|
62
|
+
current = 3 * current + 1
|
|
63
|
+
seq.append(current)
|
|
64
|
+
|
|
65
|
+
sequences[str(n)] = seq
|
|
66
|
+
|
|
67
|
+
return {"sequences": sequences}
|