pgc-workloads 2.0.0__py3-none-any.whl

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 (46) hide show
  1. pgc_workloads-2.0.0.dist-info/METADATA +131 -0
  2. pgc_workloads-2.0.0.dist-info/RECORD +46 -0
  3. pgc_workloads-2.0.0.dist-info/WHEEL +5 -0
  4. pgc_workloads-2.0.0.dist-info/licenses/LICENSE +67 -0
  5. pgc_workloads-2.0.0.dist-info/licenses/NOTICE +11 -0
  6. pgc_workloads-2.0.0.dist-info/top_level.txt +1 -0
  7. workloads/__init__.py +0 -0
  8. workloads/collatz/__init__.py +0 -0
  9. workloads/collatz/client/bindings/http.json +6 -0
  10. workloads/collatz/implementation/__init__.py +0 -0
  11. workloads/collatz/implementation/capability_transforms/__init__.py +0 -0
  12. workloads/collatz/implementation/capability_transforms/atoms/__init__.py +0 -0
  13. workloads/collatz/implementation/capability_transforms/atoms/ct_pure_collatz_step_v0.py +67 -0
  14. workloads/collatz/implementation/capability_transforms/atoms/ct_pure_termination_check_v0.py +59 -0
  15. workloads/collatz/snapshot/compiled/behavior_logic/WF_COLLATZ_CONJECTURE_V0/WF_COLLATZ_CONJECTURE_V0.graph.json +209 -0
  16. workloads/collatz/snapshot/compiled/canonical/actors/workload__AC_REFERENCE_ACTOR_V0.json +33 -0
  17. workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_COMPUTE_SEQUENCES_V0.json +84 -0
  18. workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_STORE_RESULTS_V0.json +102 -0
  19. workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_VERIFY_TERMINATION_V0.json +96 -0
  20. workloads/collatz/snapshot/compiled/canonical/capability_side_effects/capability_side_effects__CS_MUTABLE_JSON_V0.json +439 -0
  21. workloads/collatz/snapshot/compiled/canonical/capability_transforms/workload__CT_PURE_COLLATZ_STEP_V0.json +79 -0
  22. workloads/collatz/snapshot/compiled/canonical/capability_transforms/workload__CT_PURE_TERMINATION_CHECK_V0.json +87 -0
  23. workloads/collatz/snapshot/compiled/canonical/events/workload__EV_CONJECTURE_EVALUATED_V0.json +33 -0
  24. workloads/collatz/snapshot/compiled/canonical/ingress_intents/workload__TI_COLLATZ_COMPUTE_V0.json +40 -0
  25. workloads/collatz/snapshot/compiled/canonical/intents/workload__IN_COLLATZ_INPUT_VALIDATED_V0.json +47 -0
  26. workloads/collatz/snapshot/compiled/canonical/metadata.json +10 -0
  27. workloads/collatz/snapshot/compiled/canonical/runtime_bindings/workload__RB_COLLATZ_V0.json +35 -0
  28. workloads/collatz/snapshot/compiled/canonical/structures/workload__STRUCTURE_BUILD_WORKLOAD_CONFIG_V0.json +140 -0
  29. workloads/collatz/snapshot/compiled/canonical/structures/workload__STRUCTURE_COLLATZ_STORAGE_V0.json +40 -0
  30. workloads/collatz/snapshot/compiled/canonical/transport/egress/workload__TE_COLLATZ_COMPUTE_V0.json +50 -0
  31. workloads/collatz/snapshot/compiled/canonical/workflows/workload__WF_COLLATZ_CONJECTURE_V0.json +99 -0
  32. workloads/collatz/snapshot/compiled/evidence/workload/evidence.json +291 -0
  33. workloads/collatz/snapshot/compiled/evidence/workload/evidence_graph.json +1112 -0
  34. workloads/collatz/snapshot/compiled/evidence/workload/metadata.json +16 -0
  35. workloads/collatz/snapshot/compiled/tokenized/workload/dispatch.json +167 -0
  36. workloads/collatz/snapshot/compiled/tokenized/workload/handlers.json +300 -0
  37. workloads/collatz/snapshot/compiled/tokenized/workload/metadata.json +15 -0
  38. workloads/collatz/snapshot/compiled/tokenized/workload/topology.json +158 -0
  39. workloads/collatz/snapshot/compiled/trust/workload/structure_attestation.json +15 -0
  40. workloads/collatz/snapshot/compiled/vocabulary/workload/forward.json +53 -0
  41. workloads/collatz/snapshot/compiled/vocabulary/workload/metadata.json +13 -0
  42. workloads/collatz/snapshot/compiled/vocabulary/workload/reverse.json +53 -0
  43. workloads/collatz/snapshot/determinations/STRUCTURE_BUILD_WORKLOAD_CONFIG_V0.admitted.json +642 -0
  44. workloads/collatz/test_payloads/01_happy_path.json +3 -0
  45. workloads/collatz/test_payloads/02_single_number.json +3 -0
  46. workloads/collatz/test_payloads/03_invalid_nack.json +3 -0
@@ -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,46 @@
1
+ pgc_workloads-2.0.0.dist-info/licenses/LICENSE,sha256=wf4s-Px76q2zHB2b8Gbvuu4ULua8AMds2IY01MkBn0A,2544
2
+ pgc_workloads-2.0.0.dist-info/licenses/NOTICE,sha256=nE4--l6r3rMCz0nVaFyFohZtY4NYADnrhcS9K2pdNr0,407
3
+ workloads/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ workloads/collatz/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ workloads/collatz/client/bindings/http.json,sha256=HeGvwHGcWkMsZYoAW-r0Bs3OoWV_2bIc4fHqs41AoXc,298
6
+ workloads/collatz/implementation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ workloads/collatz/implementation/capability_transforms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ workloads/collatz/implementation/capability_transforms/atoms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ workloads/collatz/implementation/capability_transforms/atoms/ct_pure_collatz_step_v0.py,sha256=8x2uQWb3Xdp1AbASzKu6eUmboI6BUR1jwWWWq8bSknE,1858
10
+ workloads/collatz/implementation/capability_transforms/atoms/ct_pure_termination_check_v0.py,sha256=QR86MObF6gktMrk2dPziC8PjSghpzPSf64TnzMlmqK4,1593
11
+ workloads/collatz/snapshot/compiled/behavior_logic/WF_COLLATZ_CONJECTURE_V0/WF_COLLATZ_CONJECTURE_V0.graph.json,sha256=GUmrQMOr2YA4sZFRgpt4_OTPUxdcSKQab5Sf5s1K16E,4963
12
+ workloads/collatz/snapshot/compiled/canonical/metadata.json,sha256=fVElpklNjPRrBx9dh3D-agP7yKYxMzQ89dYz_mCFyHY,453
13
+ workloads/collatz/snapshot/compiled/canonical/actors/workload__AC_REFERENCE_ACTOR_V0.json,sha256=r5ojMccGhAdkRfQKNlrLtT1UTYpaCw8aVgrhRPFWPVU,2095
14
+ workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_COMPUTE_SEQUENCES_V0.json,sha256=JEgDJlvHN-cfOZav8uV0WO5z0hopqNmpF9RrrI4xWsU,3157
15
+ workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_STORE_RESULTS_V0.json,sha256=FZS052UeFooLJQfUmJH3CaN_KpRurN6JbfpLVXEqPIs,4164
16
+ workloads/collatz/snapshot/compiled/canonical/capability_contracts/workload__CC_VERIFY_TERMINATION_V0.json,sha256=zMRLX67ncPR3cSCqE_Ls7jJPnO28KyxQskoQLACr9Lc,4059
17
+ workloads/collatz/snapshot/compiled/canonical/capability_side_effects/capability_side_effects__CS_MUTABLE_JSON_V0.json,sha256=dzNuLJ4eDEWtlIUnjc4KoWXz4VE9Q3WbPAgjnsfSQ5Q,13064
18
+ workloads/collatz/snapshot/compiled/canonical/capability_transforms/workload__CT_PURE_COLLATZ_STEP_V0.json,sha256=2q0kJ-CKLePo-_cImqI1H39NjRy6TPvsl6mS_t5iOZk,3532
19
+ workloads/collatz/snapshot/compiled/canonical/capability_transforms/workload__CT_PURE_TERMINATION_CHECK_V0.json,sha256=2CSOPIEyurKyB8xYmFfkqoFwj-RGBIGF6r0ICBkMMTA,3885
20
+ workloads/collatz/snapshot/compiled/canonical/events/workload__EV_CONJECTURE_EVALUATED_V0.json,sha256=PfPbnKWdAn9V_SSeIsLkiopm72mTAehr_8D_9FTpvt0,1668
21
+ workloads/collatz/snapshot/compiled/canonical/ingress_intents/workload__TI_COLLATZ_COMPUTE_V0.json,sha256=5dGQRS4ABbZDm_XdNc_TpJGAXOekOM-07CxVorOlNOY,2965
22
+ workloads/collatz/snapshot/compiled/canonical/intents/workload__IN_COLLATZ_INPUT_VALIDATED_V0.json,sha256=So0ntYuP7OOBLB7EM8eOMS2z2cbYow3PqiBgoHI5G_4,2233
23
+ workloads/collatz/snapshot/compiled/canonical/runtime_bindings/workload__RB_COLLATZ_V0.json,sha256=g31j0QMwK5WNym_k8PCiRCx3RwJoVo1LhCbjB5pxnHI,2024
24
+ workloads/collatz/snapshot/compiled/canonical/structures/workload__STRUCTURE_BUILD_WORKLOAD_CONFIG_V0.json,sha256=1pH75DSKsxVCbpAWlzl2SY8ZX8ViKXcIJVtkG8jrv0g,7701
25
+ workloads/collatz/snapshot/compiled/canonical/structures/workload__STRUCTURE_COLLATZ_STORAGE_V0.json,sha256=QzV-UuJdjKKGceJ_r_0M8v-N18ZZCzfPaPDimkdldfo,2659
26
+ workloads/collatz/snapshot/compiled/canonical/transport/egress/workload__TE_COLLATZ_COMPUTE_V0.json,sha256=OiMYXrVFPU-Rksk3x3Bzf35BT5Y47tXqcc3A-OAc2Dc,3281
27
+ workloads/collatz/snapshot/compiled/canonical/workflows/workload__WF_COLLATZ_CONJECTURE_V0.json,sha256=uxr4MxuKbJZOVCPQQPrVWQiGlxY7_yq3aE6nkAHdbdo,6323
28
+ workloads/collatz/snapshot/compiled/evidence/workload/evidence.json,sha256=dP3LxWfImyp9o7dEXrcyHIARufgIhfBqbYiAOXlCMEo,7604
29
+ workloads/collatz/snapshot/compiled/evidence/workload/evidence_graph.json,sha256=1uedWBzNz4G0ZcJMhmDO9iieZsyU79va0k_sx9dqN2c,29702
30
+ workloads/collatz/snapshot/compiled/evidence/workload/metadata.json,sha256=KQ1Kd9CzxgmHx-eNJkgt0IsxAC3qFhvrGLWJwcoZsbY,724
31
+ workloads/collatz/snapshot/compiled/tokenized/workload/dispatch.json,sha256=Y-VQNbgtoAGjkR4LZHq4R1qltvK_ir4pzpKtOxGjySo,3517
32
+ workloads/collatz/snapshot/compiled/tokenized/workload/handlers.json,sha256=HgZrNFbC8q_9T7PH74Nz7n18h_MXZIvAHC-XYVdVHi8,9665
33
+ workloads/collatz/snapshot/compiled/tokenized/workload/metadata.json,sha256=oX5vWKeexeaUh7-OfgPKJlcoLM6047n7JEKlgcLdPqc,666
34
+ workloads/collatz/snapshot/compiled/tokenized/workload/topology.json,sha256=uGhgEQQSILwBlkumpGqgD8ffsCrY0J2AWXoOvnXw6tc,2010
35
+ workloads/collatz/snapshot/compiled/trust/workload/structure_attestation.json,sha256=Zu8oHA1eLioQTrkW0DV7_1dtoox-UPQ9atuScQJabU4,609
36
+ workloads/collatz/snapshot/compiled/vocabulary/workload/forward.json,sha256=LfrgmAJabXOxnIS-ausxzH0qd290IR329osu6rG1x6k,2025
37
+ workloads/collatz/snapshot/compiled/vocabulary/workload/metadata.json,sha256=oN3FwFkHJdwY1CNcaWhvNZYZ2H5rcDrye5wJASK8UMc,559
38
+ workloads/collatz/snapshot/compiled/vocabulary/workload/reverse.json,sha256=Qi8hYb092LSuIIHD5Q3km2etuH_2QJlWr86W8U3AanI,2025
39
+ workloads/collatz/snapshot/determinations/STRUCTURE_BUILD_WORKLOAD_CONFIG_V0.admitted.json,sha256=utlAZpOx3sJf54WIb8LmIok51-HHbOD6Wdd3Mw4St9g,19782
40
+ workloads/collatz/test_payloads/01_happy_path.json,sha256=I4FsN4EnD4CdXbbn3xPd1TNjfODUdvGiULUtT0FjoYU,59
41
+ workloads/collatz/test_payloads/02_single_number.json,sha256=qWtcocMfUY2sU8nQfrIjjmq11ogypgTW-5JkRaXg-YE,22
42
+ workloads/collatz/test_payloads/03_invalid_nack.json,sha256=oYO5JwAeqe_-djUkD1x-3lrP0lUL4LGdgUtxep606GY,29
43
+ pgc_workloads-2.0.0.dist-info/METADATA,sha256=MT9jCqlExMtxkhh3uNOmK7yWh_CrVJ2GthcNIGCHU2o,5900
44
+ pgc_workloads-2.0.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
45
+ pgc_workloads-2.0.0.dist-info/top_level.txt,sha256=AebziWFXu5criTVhZfHvsLpwDAWzCFR3T1hglhpcWko,10
46
+ pgc_workloads-2.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -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 @@
1
+ workloads
workloads/__init__.py ADDED
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
@@ -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}
@@ -0,0 +1,59 @@
1
+ """
2
+ CT_TERMINATION_CHECK_V0
3
+
4
+ Pure Capability Transform (Atom)
5
+
6
+ Purpose:
7
+ Verify that every Collatz sequence in the input terminates at 1.
8
+
9
+ Implementation:
10
+ - Inspects last element of each sequence
11
+ - Collects any sequences that do not end at 1
12
+ - Returns all_terminate flag and list of non-terminating seeds
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_TERMINATION_CHECK_V0.
25
+
26
+ Inputs:
27
+ sequences (dict): Mapping from str(n) → list of integers (Collatz sequences)
28
+
29
+ Outputs:
30
+ all_terminate (bool): True if every sequence ends at 1
31
+ non_terminating (list): Seeds whose sequences did not end at 1
32
+ """
33
+ if "sequences" not in inputs:
34
+ raise CTExecutionError(
35
+ "CT_TERMINATION_CHECK_V0: missing required input 'sequences'"
36
+ )
37
+
38
+ sequences = inputs["sequences"]
39
+
40
+ if not isinstance(sequences, dict):
41
+ raise CTExecutionError(
42
+ f"CT_TERMINATION_CHECK_V0: 'sequences' must be a dict, got {type(sequences).__name__}"
43
+ )
44
+
45
+ non_terminating: List[str] = []
46
+
47
+ for seed, seq in sequences.items():
48
+ if not isinstance(seq, list) or len(seq) == 0:
49
+ non_terminating.append(seed)
50
+ continue
51
+ if seq[-1] != 1:
52
+ non_terminating.append(seed)
53
+
54
+ all_terminate = len(non_terminating) == 0
55
+
56
+ return {
57
+ "all_terminate": all_terminate,
58
+ "non_terminating": non_terminating,
59
+ }
@@ -0,0 +1,209 @@
1
+ {
2
+ "wf_id": "WF_COLLATZ_CONJECTURE_V0",
3
+ "entry": "IN_COLLATZ_INPUT_VALIDATED_V0",
4
+ "nodes": [
5
+ {
6
+ "id": "CC_COMPUTE_SEQUENCES_V0",
7
+ "type": "CC",
8
+ "cc_code": "CC_COMPUTE_SEQUENCES_V0",
9
+ "capability": "workload::CT_PURE_COLLATZ_STEP_V0",
10
+ "capability_type": "CT",
11
+ "projection": {
12
+ "steps": [
13
+ {
14
+ "bindings": {
15
+ "numbers": "in.numbers"
16
+ },
17
+ "fqdn": "workload::CT_PURE_COLLATZ_STEP_V0",
18
+ "id": "CT_PURE_COLLATZ_STEP_V0",
19
+ "inputs": [
20
+ "numbers"
21
+ ],
22
+ "kind": "CT",
23
+ "outputs": [
24
+ "sequences"
25
+ ]
26
+ }
27
+ ]
28
+ },
29
+ "input_bindings": {
30
+ "type": "wf_boundary",
31
+ "bindings": {
32
+ "numbers": "IN.numbers"
33
+ }
34
+ }
35
+ },
36
+ {
37
+ "id": "CC_STORE_RESULTS_V0",
38
+ "type": "CC",
39
+ "cc_code": "CC_STORE_RESULTS_V0",
40
+ "capability": "capability_side_effects::CS_MUTABLE_JSON_V0",
41
+ "capability_type": "CS",
42
+ "projection": {
43
+ "steps": [
44
+ {
45
+ "fqdn": "capability_side_effects::CS_MUTABLE_JSON_V0",
46
+ "id": "CS_MUTABLE_JSON_V0",
47
+ "kind": "CS",
48
+ "ops": [
49
+ "READ",
50
+ "WRITE",
51
+ "UPDATE",
52
+ "DELETE",
53
+ "DELETE_MANY"
54
+ ],
55
+ "ops_truncated": true,
56
+ "outputs": [
57
+ "result_status"
58
+ ]
59
+ }
60
+ ]
61
+ },
62
+ "input_bindings": {
63
+ "type": "wf_boundary",
64
+ "bindings": {
65
+ "all_terminate": "CC_VERIFY_TERMINATION_V0.all_terminate",
66
+ "non_terminating": "CC_VERIFY_TERMINATION_V0.non_terminating",
67
+ "sequences": "CC_COMPUTE_SEQUENCES_V0.sequences"
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "id": "CC_VERIFY_TERMINATION_V0",
73
+ "type": "CC",
74
+ "cc_code": "CC_VERIFY_TERMINATION_V0",
75
+ "capability": "workload::CT_PURE_TERMINATION_CHECK_V0",
76
+ "capability_type": "CT",
77
+ "projection": {
78
+ "steps": [
79
+ {
80
+ "bindings": {
81
+ "sequences": "in.sequences"
82
+ },
83
+ "fqdn": "workload::CT_PURE_TERMINATION_CHECK_V0",
84
+ "id": "CT_PURE_TERMINATION_CHECK_V0",
85
+ "inputs": [
86
+ "sequences"
87
+ ],
88
+ "kind": "CT",
89
+ "outputs": [
90
+ "all_terminate",
91
+ "non_terminating"
92
+ ]
93
+ }
94
+ ]
95
+ },
96
+ "input_bindings": {
97
+ "type": "wf_boundary",
98
+ "bindings": {
99
+ "sequences": "CC_COMPUTE_SEQUENCES_V0.sequences"
100
+ }
101
+ }
102
+ },
103
+ {
104
+ "id": "EXIT_CONJECTURE_PROVEN",
105
+ "type": "EXIT"
106
+ },
107
+ {
108
+ "id": "EXIT_CONJECTURE_VIOLATED",
109
+ "type": "EXIT"
110
+ },
111
+ {
112
+ "id": "EXIT_ERROR",
113
+ "type": "EXIT"
114
+ },
115
+ {
116
+ "id": "EXIT_REJECTED",
117
+ "type": "EXIT"
118
+ },
119
+ {
120
+ "id": "IN_COLLATZ_INPUT_VALIDATED_V0",
121
+ "type": "IN"
122
+ }
123
+ ],
124
+ "edges": [
125
+ {
126
+ "from": "CC_COMPUTE_SEQUENCES_V0",
127
+ "to": "CC_VERIFY_TERMINATION_V0",
128
+ "condition": "SUCCESS"
129
+ },
130
+ {
131
+ "from": "CC_COMPUTE_SEQUENCES_V0",
132
+ "to": "EXIT_ERROR",
133
+ "condition": "VIOLATION"
134
+ },
135
+ {
136
+ "from": "CC_STORE_RESULTS_V0",
137
+ "to": "EXIT_ERROR",
138
+ "condition": "BACKEND_ERROR"
139
+ },
140
+ {
141
+ "from": "CC_STORE_RESULTS_V0",
142
+ "to": "EXIT_CONJECTURE_PROVEN",
143
+ "condition": "SUCCESS"
144
+ },
145
+ {
146
+ "from": "CC_STORE_RESULTS_V0",
147
+ "to": "EXIT_ERROR",
148
+ "condition": "VIOLATION"
149
+ },
150
+ {
151
+ "from": "CC_VERIFY_TERMINATION_V0",
152
+ "to": "CC_STORE_RESULTS_V0",
153
+ "condition": "SUCCESS"
154
+ },
155
+ {
156
+ "from": "CC_VERIFY_TERMINATION_V0",
157
+ "to": "EXIT_CONJECTURE_VIOLATED",
158
+ "condition": "VIOLATION"
159
+ },
160
+ {
161
+ "from": "IN_COLLATZ_INPUT_VALIDATED_V0",
162
+ "to": "CC_COMPUTE_SEQUENCES_V0",
163
+ "condition": "ACK"
164
+ },
165
+ {
166
+ "from": "IN_COLLATZ_INPUT_VALIDATED_V0",
167
+ "to": "EXIT_REJECTED",
168
+ "condition": "NACK"
169
+ }
170
+ ],
171
+ "execution_paths": [
172
+ [
173
+ "IN_COLLATZ_INPUT_VALIDATED_V0",
174
+ "CC_COMPUTE_SEQUENCES_V0",
175
+ "CC_VERIFY_TERMINATION_V0",
176
+ "CC_STORE_RESULTS_V0",
177
+ "EXIT_ERROR"
178
+ ],
179
+ [
180
+ "IN_COLLATZ_INPUT_VALIDATED_V0",
181
+ "CC_COMPUTE_SEQUENCES_V0",
182
+ "CC_VERIFY_TERMINATION_V0",
183
+ "CC_STORE_RESULTS_V0",
184
+ "EXIT_CONJECTURE_PROVEN"
185
+ ],
186
+ [
187
+ "IN_COLLATZ_INPUT_VALIDATED_V0",
188
+ "CC_COMPUTE_SEQUENCES_V0",
189
+ "CC_VERIFY_TERMINATION_V0",
190
+ "CC_STORE_RESULTS_V0",
191
+ "EXIT_ERROR"
192
+ ],
193
+ [
194
+ "IN_COLLATZ_INPUT_VALIDATED_V0",
195
+ "CC_COMPUTE_SEQUENCES_V0",
196
+ "CC_VERIFY_TERMINATION_V0",
197
+ "EXIT_CONJECTURE_VIOLATED"
198
+ ],
199
+ [
200
+ "IN_COLLATZ_INPUT_VALIDATED_V0",
201
+ "CC_COMPUTE_SEQUENCES_V0",
202
+ "EXIT_ERROR"
203
+ ],
204
+ [
205
+ "IN_COLLATZ_INPUT_VALIDATED_V0",
206
+ "EXIT_REJECTED"
207
+ ]
208
+ ]
209
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "artifact_code": "AC_REFERENCE_ACTOR_V0",
3
+ "artifact_type": "AC",
4
+ "content": "# AC_REFERENCE_ACTOR_V0\n\n## 1. Intent\n\nActor context under which the Collatz reference workflow executes. This is the Authority concern at\nits declaration/binding stage: a named actor that the workflow binds and the runtime propagates into\nthe execution context and attributes in the trace.\n\n**Scope note:** this artifact declares an actor *identity/context* only. It does NOT implement\nauthorization or enforcement \u2014 real authority checks belong to the governance/authority model and are\nout of scope here. The reference value is the lifecycle it demonstrates:\n`declaration \u2192 workflow binding \u2192 runtime context propagation \u2192 trace attribution`.\n\n---\n\n## Machine\n\n```yaml\nfqdn: workload::AC_REFERENCE_ACTOR_V0\nartifact_kind: ACTOR\nversion: v0\ngoverned_by: actor::CONSTITUTION_ACTOR_IDENTITY_V0\nauthority: pgc.platform\nconcern: workload\ncore:\n summary: Reference workload actor\n description: System actor context under which the Collatz reference workload executes.\n type: system\n attributes:\n role:\n type: string\n required: true\n value: reference_workload_runner\n```\n",
5
+ "content_hash": "2623143eb6d65e774c62d5194728350b8f61f5b38c82e76659e3bbed5215f9d6",
6
+ "fqdn_id": "workload::AC_REFERENCE_ACTOR_V0",
7
+ "frontmatter": {
8
+ "artifact_kind": "ACTOR",
9
+ "authority": "pgc.platform",
10
+ "concern": "workload",
11
+ "core": {
12
+ "attributes": {
13
+ "role": {
14
+ "required": true,
15
+ "type": "string",
16
+ "value": "reference_workload_runner"
17
+ }
18
+ },
19
+ "description": "System actor context under which the Collatz reference workload executes.",
20
+ "summary": "Reference workload actor",
21
+ "type": "system"
22
+ },
23
+ "fqdn": "workload::AC_REFERENCE_ACTOR_V0",
24
+ "governed_by": "actor::CONSTITUTION_ACTOR_IDENTITY_V0",
25
+ "version": "v0"
26
+ },
27
+ "layer_code": "WORKLOAD",
28
+ "namespace": "workload",
29
+ "references": [
30
+ "actor::CONSTITUTION_ACTOR_IDENTITY_V0"
31
+ ],
32
+ "version": "0"
33
+ }