codecraftai-interop-ext-tasker 1.3.2__tar.gz → 1.4.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 (35) hide show
  1. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/LICENSE.md +30 -21
  2. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/PKG-INFO +3 -1
  3. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/pyproject.toml +3 -1
  4. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskercontroller.py +10 -1
  5. codecraftai_interop_ext_tasker-1.4.0/source/packages/ccai/interop/protocols/tasker/taskerserver.py +254 -0
  6. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskerservermanager.py +20 -4
  7. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/landscaping/clients/taskers/linux/linuxtaskerclient.py +1 -1
  8. codecraftai_interop_ext_tasker-1.3.2/source/packages/ccai/interop/protocols/tasker/taskerserver.py +0 -159
  9. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/README.rst +0 -0
  10. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/__init__.py +0 -0
  11. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/examples/helloworldtasking.py +0 -0
  12. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/itaskingsequencer.py +0 -0
  13. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/linux/tasker-service.template +0 -0
  14. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/linux/taskerservice +0 -0
  15. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/py.typed +0 -0
  16. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskeraspects.py +0 -0
  17. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskerdaemon.py +0 -0
  18. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskerexceptions.py +0 -0
  19. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskernode.py +0 -0
  20. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskerservice.py +0 -0
  21. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskersession.py +0 -0
  22. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/tasking.py +0 -0
  23. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskingadapter.py +0 -0
  24. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskingevent.py +0 -0
  25. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskinggroupscope.py +0 -0
  26. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskingprogressmonitor.py +0 -0
  27. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/interop/protocols/tasker/taskingresultpromise.py +0 -0
  28. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/landscaping/clients/taskers/clientroles.py +0 -0
  29. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/landscaping/clients/taskers/constants.py +0 -0
  30. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/landscaping/clients/taskers/linux/__init__.py +0 -0
  31. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/landscaping/clients/taskers/linux/ext/commandsext.py +0 -0
  32. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/landscaping/clients/taskers/linux/ext/configureext.py +0 -0
  33. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/landscaping/clients/taskers/linux/linuxtaskerclientcoordinator.py +0 -0
  34. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/landscaping/clients/taskers/linux/linuxtaskerclientcoordinatorcoupling.py +0 -0
  35. {codecraftai_interop_ext_tasker-1.3.2 → codecraftai_interop_ext_tasker-1.4.0}/source/packages/ccai/landscaping/clients/taskers/py.typed +0 -0
@@ -1,5 +1,5 @@
1
1
  # Code Craft AI - Source Available License
2
- Version 1.0, October 2026
2
+ Version 1.1, November 2026
3
3
 
4
4
  Copyright (C) 2026, Code Craft AI LLC
5
5
 
@@ -7,12 +7,12 @@ Everyone is permitted to copy and distribute verbatim copies of *This License* d
7
7
 
8
8
  *This License* covers the Python Automation Kit, the full suite of software published by *Licensor* that consists of every `codecraftai-*` package, every `pychestrate` package, and the `pychestrate` server.
9
9
 
10
- *The Software* is source available. Its source code is published so that anyone can read it, learn from it, and use it, but *This License* is not an open source license. *The Software* is free to use for *Non-Commercial Use*. *Commercial Use* is permitted in exchange for a *Usage Fee* that is based on a reasonable estimation of the income derived from *The Software*, as described in section 5. When a company migrates a product or service to *The Software* from another code base, the *Profit* from that product or service is not counted toward the *Usage Fee* for two years, as described in section 5.4. For assurance of costs, a company can disclose its usage and estimated returns to *Licensor* and negotiate a fixed license cost, as described in section 5.10.
10
+ *The Software* is source available. Its source code is published so that anyone can read it, learn from it, and use it, but *This License* is not an open source license. *The Software* is free to use for *Non-Commercial Use*. *Commercial Use* is permitted in exchange for a *Usage Fee* that is based on a reasonable estimation of the income derived from *The Software*, as described in section 5. That estimation starts from *Gross Income*, not net profit, so spending on research and development or other operating expenses does not reduce it. When a company migrates a product or service to *The Software* from another code base, the *Gross Income* from that product or service is not counted toward the *Usage Fee* for two years, as described in section 5.4. For assurance of costs, a company can disclose its usage and estimated returns to *Licensor* and negotiate a fixed license cost, as described in section 5.10.
11
11
 
12
12
  ## 1. Definitions
13
13
 
14
14
  ### 1.1 *This License* or *The License*
15
- **This License** or **The License** refers to version 1.0 of the Code Craft AI - Source Available License.
15
+ **This License** or **The License** refers to version 1.1 of the Code Craft AI - Source Available License.
16
16
 
17
17
  ### 1.2 Licensor
18
18
  **Licensor** refers to Code Craft AI LLC.
@@ -42,14 +42,14 @@ Everyone is permitted to copy and distribute verbatim copies of *This License* d
42
42
  ### 1.9 Fiscal Year
43
43
  **Fiscal Year** means the annual accounting period that *You* use for financial reporting.
44
44
 
45
- ### 1.10 Profit
46
- **Profit** means the net profit that *You* earn from the *Commercial Activity* during a *Fiscal Year*, determined under the accounting principles that *You* regularly use for financial reporting.
45
+ ### 1.10 Gross Income
46
+ **Gross Income** means, for each product or service in connection with which *You* make *Commercial Use* of *The Software*, the gross profit that *You* earn from that product or service during a *Fiscal Year*: the revenue from that product or service, less its cost of goods sold or cost of revenue, determined under the accounting principles that *You* regularly use for financial reporting. *Gross Income* is calculated before operating expenses, such as research and development, sales and marketing, and general and administrative expenses, and before interest and taxes. *Gross Income* is measured for the products and services that *The Software* is used for, not for *Your* business as a whole.
47
47
 
48
48
  ### 1.11 Contribution Estimate
49
- **Contribution Estimate** means *Your* reasonable, good faith estimate of the portion of the *Profit* that *The Software* contributed to, expressed as a number from 0 to 1.
49
+ **Contribution Estimate** means *Your* reasonable, good faith estimate of the portion of the *Gross Income* that *The Software* contributed to, expressed as a number from 0 to 1.
50
50
 
51
51
  ### 1.12 Derived Income
52
- **Derived Income** means the portion of the *Profit* for a *Fiscal Year* that is derived from *The Software*, calculated as described in section 5.2.
52
+ **Derived Income** means the portion of the *Gross Income* for a *Fiscal Year* that is derived from *The Software*, calculated as described in section 5.2.
53
53
 
54
54
  ### 1.13 Usage Fee
55
55
  **Usage Fee** means the yearly fee for *Commercial Use* that is set by the table in section 5.3.
@@ -58,7 +58,7 @@ Everyone is permitted to copy and distribute verbatim copies of *This License* d
58
58
  **Migration** means moving the work for one of *Your* products or services from a code base other than *The Software*, such as another framework, another library, or *Your* own code, to *The Software*.
59
59
 
60
60
  ### 1.15 Migration Period
61
- **Migration Period** means the two (2) year period, described in section 5.4, during which the *Profit* from a product or service that *You* are migrating to *The Software* is not counted.
61
+ **Migration Period** means the two (2) year period, described in section 5.4, during which the *Gross Income* from a product or service that *You* are migrating to *The Software* is not counted.
62
62
 
63
63
  ## 2. License Grant
64
64
 
@@ -96,11 +96,11 @@ For each *Fiscal Year* in which *You* make *Commercial Use* of *The Software*, *
96
96
  ### 5.2 Derived Income
97
97
  The *Derived Income* for a *Fiscal Year* is calculated as follows:
98
98
 
99
- (Contribution Estimate) * (Profit) = (Derived Income)
99
+ (Contribution Estimate) * (Gross Income) = (Derived Income)
100
100
 
101
- If *You* make *Commercial Use* of *The Software* for more than one product or service, calculate the *Derived Income* for each product or service using its own *Contribution Estimate* and *Profit*, and add the results together. The *Profit* from a product or service that is in its *Migration Period* is not counted, as described in section 5.4.
101
+ If *You* make *Commercial Use* of *The Software* for more than one product or service, calculate the *Derived Income* for each product or service using its own *Contribution Estimate* and *Gross Income*, and add the results together. The *Gross Income* from a product or service that is in its *Migration Period* is not counted, as described in section 5.4.
102
102
 
103
- If the *Profit* from a product or service for a *Fiscal Year* is zero or less, then the *Derived Income* from that product or service for that *Fiscal Year* is zero.
103
+ If the *Gross Income* from a product or service for a *Fiscal Year* is zero or less, then the *Derived Income* from that product or service for that *Fiscal Year* is zero.
104
104
 
105
105
  ### 5.3 Usage Fee
106
106
  The *Usage Fee* for a *Fiscal Year* is set by the *Derived Income* for that *Fiscal Year*, as shown in the following table.
@@ -113,56 +113,65 @@ The *Usage Fee* for a *Fiscal Year* is set by the *Derived Income* for that *Fis
113
113
  | More than 100,000,000, up to and including 1,000,000,000 | 250,000 |
114
114
  | More than 1,000,000,000 | 500,000 |
115
115
 
116
- All amounts in this section 5 are in United States dollars. If *You* report *Profit* in a different currency, convert the *Derived Income* to United States dollars using the average exchange rate for the *Fiscal Year*.
116
+ All amounts in this section 5 are in United States dollars. If *You* report *Gross Income* in a different currency, convert the *Derived Income* to United States dollars using the average exchange rate for the *Fiscal Year*.
117
117
 
118
118
  ### 5.4 Migration Allowance
119
- When *You* migrate a product or service to *The Software*, the *Profit* from that product or service is not counted when calculating the *Derived Income* during its *Migration Period* (the **Migration Allowance**).
119
+ When *You* migrate a product or service to *The Software*, the *Gross Income* from that product or service is not counted when calculating the *Derived Income* during its *Migration Period* (the **Migration Allowance**).
120
120
 
121
121
  The *Migration Period* for a product or service begins on the date that *You* first make *Commercial Use* of *The Software* for that product or service as part of its *Migration*, and ends two (2) years after that date.
122
122
 
123
123
  The *Migration Allowance* applies to each product or service separately, and *You* may use it for every product or service that *You* migrate. Each product or service has only one *Migration Period*.
124
124
 
125
- If a *Fiscal Year* is only partly within the *Migration Period* of a product or service, the *Profit* from that product or service for that *Fiscal Year* is reduced in proportion to the number of days of that *Fiscal Year* that fall within its *Migration Period*.
125
+ If a *Fiscal Year* is only partly within the *Migration Period* of a product or service, the *Gross Income* from that product or service for that *Fiscal Year* is reduced in proportion to the number of days of that *Fiscal Year* that fall within its *Migration Period*.
126
126
 
127
- For example, a company tests product A with *The Software* and pays a *Usage Fee* based on the *Profit* from product A. On March 1, 2027, the company begins moving the testing of product B from a different test framework to *The Software*. The company does not count the *Profit* from product B in its *Derived Income* from March 1, 2027 until March 1, 2029. Starting March 1, 2029, the *Profit* from product B is counted. If the company later migrates product C, the *Profit* from product C is not counted for two years from the start of its own *Migration*.
127
+ For example, a company tests product A with *The Software* and pays a *Usage Fee* based on the *Gross Income* from product A. On March 1, 2027, the company begins moving the testing of product B from a different test framework to *The Software*. The company does not count the *Gross Income* from product B in its *Derived Income* from March 1, 2027 until March 1, 2029. Starting March 1, 2029, the *Gross Income* from product B is counted. If the company later migrates product C, the *Gross Income* from product C is not counted for two years from the start of its own *Migration*.
128
128
 
129
129
  ### 5.5 Contribution Estimate
130
130
  *You* are responsible for making the *Contribution Estimate*. A *Contribution Estimate* must be reasonable and made in good faith. The *Contribution Estimate* for a product or service covers all of the *Components* that *You* *Use* for that product or service. When making the *Contribution Estimate*, *You* should consider how important *The Software* is to the *Commercial Activity*, how much of the *Commercial Activity* depends on *The Software*, and the effort and cost that *You* would otherwise need to spend to accomplish what *The Software* accomplishes for *You*.
131
131
 
132
132
  The following table is a guide for making the *Contribution Estimate*. When *Your* *Commercial Use* of *The Software* matches an entry in the table, the *Contribution Estimate* in that entry is a reasonable *Contribution Estimate*. When *Your* *Commercial Use* does not match an entry in the table, make the *Contribution Estimate* by comparing *Your* *Commercial Use* with the entries in the table. When more than one entry matches the same *Commercial Activity*, use the entry with the highest *Contribution Estimate*.
133
133
 
134
+ Many products are not software, such as devices, machines, vehicles, and other physical goods, and software accounts for only part of what such a product is worth. For a product or service that is not software, *You* may reduce the *Contribution Estimate* in proportion to the share of the value of the shipped product that its software reasonably accounts for. To do so, multiply the *Contribution Estimate* from the table by that share, expressed as a number from 0 to 1. *You* must keep records that reasonably support that share, as described in section 5.8.
135
+
134
136
  | Commercial Use of *The Software* | Contribution Estimate |
135
137
  |----------------------------------|-----------------------|
136
138
  | Quality Assurance (QA) and Continuous Integration (CI): *The Software* is used to test or validate the products or services of the *Commercial Activity*, or to run their build and test pipelines | 0.3 |
137
139
  | Products Completely Based on *The Software*: the products or services of the *Commercial Activity* are built completely on *The Software* | 0.5 |
138
140
 
139
141
  ### 5.6 Examples
140
- A company earns 1,000,000,000 in *Profit* from a product line during a *Fiscal Year*. The company uses *The Software* for the QA and CI of that product line, so the *Contribution Estimate* is 0.3.
142
+ A company earns 1,000,000,000 in *Gross Income* from a product line during a *Fiscal Year*. The company uses *The Software* for the QA and CI of that product line, so the *Contribution Estimate* is 0.3.
141
143
 
142
144
  0.3 * 1,000,000,000 = 300,000,000
143
145
 
144
146
  The *Derived Income* of 300,000,000 is more than 100,000,000 and not more than 1,000,000,000, so the *Usage Fee* for that *Fiscal Year* is 250,000.
145
147
 
146
- A company earns 4,000,000 in *Profit* from a product during a *Fiscal Year*. The product is built completely on *The Software*, so the *Contribution Estimate* is 0.5.
148
+ A company earns 4,000,000 in *Gross Income* from a product during a *Fiscal Year*. The product is built completely on *The Software*, so the *Contribution Estimate* is 0.5.
147
149
 
148
150
  0.5 * 4,000,000 = 2,000,000
149
151
 
150
152
  The *Derived Income* of 2,000,000 is more than 1,000,000 and not more than 10,000,000, so the *Usage Fee* for that *Fiscal Year* is 50,000.
151
153
 
152
- A company earns 3,000,000 in *Profit* from a product line during a *Fiscal Year*. The company uses *The Software* for the QA and CI of that product line, so the *Contribution Estimate* is 0.3.
154
+ A company earns 3,000,000 in *Gross Income* from a product line during a *Fiscal Year*. The company uses *The Software* for the QA and CI of that product line, so the *Contribution Estimate* is 0.3.
153
155
 
154
156
  0.3 * 3,000,000 = 900,000
155
157
 
156
158
  The *Derived Income* of 900,000 is 1,000,000 or less, so there is no *Usage Fee* for that *Fiscal Year*.
157
159
 
160
+ A company earns 50,000,000 in *Gross Income* from a line of medical devices during a *Fiscal Year*. The company uses *The Software* for the QA and CI of the devices, so the *Contribution Estimate* from the table is 0.3. The devices are not software, and the company reasonably estimates that their software accounts for one fifth (0.2) of the value of each shipped device, so the company reduces the *Contribution Estimate* to 0.06.
161
+
162
+ 0.3 * 0.2 = 0.06
163
+ 0.06 * 50,000,000 = 3,000,000
164
+
165
+ The *Derived Income* of 3,000,000 is more than 1,000,000 and not more than 10,000,000, so the *Usage Fee* for that *Fiscal Year* is 50,000. Without the reduction, the *Derived Income* would be 15,000,000 and the *Usage Fee* would be 100,000.
166
+
158
167
  ### 5.7 Reporting and Payment
159
- Within one hundred twenty (120) days after the end of each *Fiscal Year* for which a *Usage Fee* is owed, *You* must pay the *Usage Fee* to *Licensor* and provide *Licensor* with a written statement that shows the *Profit*, the *Contribution Estimate*, the reasoning used to make the *Contribution Estimate*, the *Derived Income*, and the *Usage Fee*. *Usage Fees* are payable in United States dollars. If any *Profit* is not counted under section 5.4, the statement must also identify each product or service that is in a *Migration Period* and show the dates of its *Migration Period*. No statement is required for a *Fiscal Year* in which no *Usage Fee* is owed.
168
+ Within one hundred twenty (120) days after the end of each *Fiscal Year* for which a *Usage Fee* is owed, *You* must pay the *Usage Fee* to *Licensor* and provide *Licensor* with a written statement that shows the *Gross Income*, the *Contribution Estimate*, the reasoning used to make the *Contribution Estimate*, the *Derived Income*, and the *Usage Fee*. *Usage Fees* are payable in United States dollars. If any *Gross Income* is not counted under section 5.4, the statement must also identify each product or service that is in a *Migration Period* and show the dates of its *Migration Period*. No statement is required for a *Fiscal Year* in which no *Usage Fee* is owed.
160
169
 
161
170
  ### 5.8 Records and Review
162
- *You* must keep records that reasonably support each *Contribution Estimate*, each *Profit* figure, and the dates of any *Migration Period* for at least three (3) years after the end of the *Fiscal Year* that they apply to. No more than once in any twelve (12) month period, *Licensor* may ask in writing for the records that support a statement, and *You* must provide them within sixty (60) days of the request. *Licensor* will treat those records as confidential.
171
+ *You* must keep records that reasonably support each *Contribution Estimate*, including any share used to reduce it under section 5.5, each *Gross Income* figure, and the dates of any *Migration Period* for at least three (3) years after the end of the *Fiscal Year* that they apply to. No more than once in any twelve (12) month period, *Licensor* may ask in writing for the records that support a statement, and *You* must provide them within sixty (60) days of the request. *Licensor* will treat those records as confidential.
163
172
 
164
173
  ### 5.9 Disputes About the Usage Fee
165
- If *Licensor* believes that a *Contribution Estimate*, a *Profit* figure, or the dates of a *Migration Period* are not reasonable, *Licensor* will notify *You* in writing and explain why. *You* and *Licensor* will then negotiate in good faith for at least sixty (60) days to agree on a reasonable *Usage Fee*. If *You* and *Licensor* cannot agree, either party may resolve the dispute as described in section 8.
174
+ If *Licensor* believes that a *Contribution Estimate*, a *Gross Income* figure, or the dates of a *Migration Period* are not reasonable, *Licensor* will notify *You* in writing and explain why. *You* and *Licensor* will then negotiate in good faith for at least sixty (60) days to agree on a reasonable *Usage Fee*. If *You* and *Licensor* cannot agree, either party may resolve the dispute as described in section 8.
166
175
 
167
176
  ### 5.10 Fixed License Cost
168
177
  For assurance of costs, *You* may disclose to *Licensor* how *You* *Use* *The Software* and the returns that *You* estimate *You* will derive from it, and negotiate a fixed license cost with *Licensor*. A fixed license cost, and any other terms that *You* and *Licensor* agree to, must be set out in a writing signed by both *You* and *Licensor* (a **Fixed License Agreement**).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codecraftai-interop-ext-tasker
3
- Version: 1.3.2
3
+ Version: 1.4.0
4
4
  Summary: Code Craft AI - Tasker Interop Extensions
5
5
  License-Expression: LicenseRef-CodeCraftAI-Source-Available
6
6
  License-File: LICENSE.md
@@ -10,11 +10,13 @@ Author-email: myron.walker@gmail.com
10
10
  Requires-Python: >=3.10,<4.0
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Operating System :: POSIX
13
+ Requires-Dist: codecraftai-credentials (>=1.0.0,<2.0.0)
13
14
  Requires-Dist: codecraftai-foundations (>=1.0.0,<2.0.0)
14
15
  Requires-Dist: codecraftai-interop (>=1.0.0,<2.0.0)
15
16
  Requires-Dist: codecraftai-landscaping (>=1.0.0,<2.0.0)
16
17
  Requires-Dist: codecraftai-testbase (>=1.0.0,<2.0.0)
17
18
  Requires-Dist: codecraftai-testplus (>=1.0.0,<2.0.0)
19
+ Requires-Dist: codecraftai-xmodules (>=1.0.0,<2.0.0)
18
20
  Requires-Dist: psutil (>=7.2.1,<8.0.0)
19
21
  Requires-Dist: requests (>=2.32.3,<3.0.0)
20
22
  Requires-Dist: rpyc (>=6.0.1,<7.0.0)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codecraftai-interop-ext-tasker"
3
- version = "1.3.2"
3
+ version = "1.4.0"
4
4
  description = "Code Craft AI - Tasker Interop Extensions"
5
5
  readme = "README.rst"
6
6
  license = "LicenseRef-CodeCraftAI-Source-Available"
@@ -15,10 +15,12 @@ classifiers = [
15
15
  requires-python = ">=3.10,<4.0"
16
16
  dependencies = [
17
17
  "codecraftai-foundations>=1.0.0,<2.0.0",
18
+ "codecraftai-credentials>=1.0.0,<2.0.0",
18
19
  "codecraftai-interop>=1.0.0,<2.0.0",
19
20
  "codecraftai-landscaping>=1.0.0,<2.0.0",
20
21
  "codecraftai-testplus>=1.0.0,<2.0.0",
21
22
  "codecraftai-testbase>=1.0.0,<2.0.0",
23
+ "codecraftai-xmodules>=1.0.0,<2.0.0",
22
24
  "rpyc>=6.0.1,<7.0.0",
23
25
  "psutil>=7.2.1,<8.0.0",
24
26
  "requests>=2.32.3,<3.0.0",
@@ -553,8 +553,10 @@ class ProcessTaskerController(TaskerController):
553
553
  self._network_started = True
554
554
 
555
555
  for nindex in range(node_count):
556
+ # The controller only talks to its own child processes, which run unauthenticated
557
+ # servers, so they are bound to the loopback interface.
556
558
  svr_mgr, tasking_svr_proxy = spawn_tasking_server_process(
557
- ("0.0.0.0", 0), logging_directory=self._logging_directory
559
+ ("127.0.0.1", 0), logging_directory=self._logging_directory
558
560
  )
559
561
 
560
562
  tasking_svr_proxy.start()
@@ -588,6 +590,13 @@ class ProcessTaskerController(TaskerController):
588
590
  for node in self._tasker_nodes:
589
591
  node.session_close()
590
592
 
593
+ # Shut down the server processes so their listeners do not outlive the network
594
+ for svr_mgr in self._svr_manager:
595
+ svr_mgr.shutdown()
596
+
597
+ self._svr_manager.clear()
598
+ self._svr_proxies.clear()
599
+
591
600
  return
592
601
 
593
602
 
@@ -0,0 +1,254 @@
1
+ """
2
+ .. module:: taskerserver
3
+ :platform: Darwin, Linux, Unix, Windows
4
+ :synopsis: Module containing the :class:`TaskerServer` class which is a host server for the
5
+ tasker :class:`TaskerService`.
6
+
7
+ .. moduleauthor:: Myron Walker <myron.walker@gmail.com>
8
+
9
+ """
10
+
11
+ __author__ = "Myron Walker"
12
+ __copyright__ = "Copyright 2025, Code Craft AI LLC"
13
+ __credits__ = []
14
+
15
+
16
+
17
+ from typing import Any, Optional, Tuple
18
+
19
+ import ipaddress
20
+ import os
21
+ import socket
22
+ import tempfile
23
+ import logging
24
+ from ccai.xmodules.xlogging.enhancedloggers import getEnhancedLogger
25
+ import threading
26
+
27
+ from logging.handlers import WatchedFileHandler
28
+ from rpyc.utils.server import ThreadedServer
29
+
30
+ from ccai.errors.exceptions import SemanticError
31
+
32
+ from ccai.interop.protocols.tasker.taskerservice import TaskerService
33
+
34
+
35
+ TASKER_PROTOCOL_CONFIG = {
36
+ "allow_public_attrs": True,
37
+ "allow_pickle": True,
38
+ "import_custom_exceptions": True,
39
+ "allow_custom_exceptions": True,
40
+ "sync_request_timeout": 60,
41
+ "logger": getEnhancedLogger()
42
+ }
43
+
44
+ LOOPBACK_HOSTNAME_IPV4 = "127.0.0.1"
45
+ LOOPBACK_HOSTNAME_IPV6 = "::1"
46
+
47
+
48
+ def resolve_tasker_bind_hostname(hostname: Optional[str], *, ipv6: bool = False,
49
+ socket_path: Optional[str] = None) -> Optional[str]:
50
+ """
51
+ Resolve the host name a :class:`TaskerServer` binds. When no host name is given the
52
+ server binds the loopback interface rather than all interfaces.
53
+
54
+ :param hostname: The host name requested by the caller or ``None``.
55
+ :param ipv6: True when the server uses IPv6.
56
+ :param socket_path: The unix socket path, when the server binds a unix socket.
57
+
58
+ :returns: The host name to bind, or ``None`` when binding a unix socket.
59
+ """
60
+ rtnval = hostname
61
+
62
+ if hostname is None and socket_path is None:
63
+ rtnval = LOOPBACK_HOSTNAME_IPV6 if ipv6 else LOOPBACK_HOSTNAME_IPV4
64
+
65
+ return rtnval
66
+
67
+
68
+ def is_loopback_bind_hostname(hostname: str, *, ipv6: bool = False) -> bool:
69
+ """
70
+ Determine if every address a host name resolves to for a passive (listening) socket
71
+ is a loopback address. The wildcard (``0.0.0.0``, ``::``, ``""``) is not loopback.
72
+
73
+ :param hostname: The host name to check.
74
+ :param ipv6: True when the server uses IPv6.
75
+
76
+ :returns: ``True`` if the host name only resolves to loopback addresses.
77
+ """
78
+ family = socket.AF_INET6 if ipv6 else socket.AF_INET
79
+
80
+ addrinfo_list = socket.getaddrinfo(hostname, 0, family=family, type=socket.SOCK_STREAM,
81
+ proto=socket.IPPROTO_TCP, flags=socket.AI_PASSIVE)
82
+
83
+ rtnval = len(addrinfo_list) > 0
84
+ for _, _, _, _, sockaddr in addrinfo_list:
85
+ if not ipaddress.ip_address(sockaddr[0]).is_loopback:
86
+ rtnval = False
87
+ break
88
+
89
+ return rtnval
90
+
91
+
92
+ def verify_tasker_bind_is_authenticated(hostname: Optional[str], authenticator: Any, *, ipv6: bool = False,
93
+ socket_path: Optional[str] = None,
94
+ allow_unauthenticated_remote: bool = False):
95
+ """
96
+ Refuse to serve the tasker service on a non-loopback address without an authenticator.
97
+ The tasker protocol enables pickle and public attributes and the service imports and
98
+ runs caller-named modules, so the authenticator is the only security boundary.
99
+
100
+ :param hostname: The host name that will be bound (after :func:`resolve_tasker_bind_hostname`).
101
+ :param authenticator: The RPyC authenticator or ``None``.
102
+ :param ipv6: True when the server uses IPv6.
103
+ :param socket_path: The unix socket path, when the server binds a unix socket.
104
+ :param allow_unauthenticated_remote: Explicit opt-out that allows a non-loopback bind
105
+ without an authenticator (isolated lab networks only).
106
+
107
+ :raises SemanticError: When a non-loopback bind is requested without an authenticator
108
+ and without the explicit opt-out.
109
+ """
110
+
111
+ if authenticator is None and socket_path is None and not allow_unauthenticated_remote:
112
+ if not is_loopback_bind_hostname(hostname, ipv6=ipv6):
113
+ errmsg_lines = [
114
+ f"Refusing to bind the tasker service to the non-loopback address {hostname!r} without an authenticator.",
115
+ "The tasker RPyC protocol is pickle-enabled and runs caller-named taskings, so an unauthenticated",
116
+ "listener on a reachable interface allows remote code execution. Pass an 'authenticator'",
117
+ "(for example rpyc SSLAuthenticator with ca_certs and cert_reqs=ssl.CERT_REQUIRED), bind",
118
+ f"'{LOOPBACK_HOSTNAME_IPV4}', or pass 'allow_unauthenticated_remote=True' to opt out explicitly."
119
+ ]
120
+ errmsg = os.linesep.join(errmsg_lines)
121
+ raise SemanticError(errmsg)
122
+
123
+ return
124
+
125
+ class TaskerServer(ThreadedServer):
126
+ """
127
+ The :class:`TaskerServer` starts an RPyC server in an internal thread that is capable of handling
128
+ requests for tasking.
129
+ """
130
+
131
+ TASKER_SERVICE_PORT = 8686
132
+
133
+
134
+ def __init__(self, hostname=None, ipv6=False, port=TASKER_SERVICE_PORT,
135
+ backlog=socket.SOMAXCONN, reuse_addr=True, authenticator=None, registrar=None,
136
+ auto_register=None, protocol_config=TASKER_PROTOCOL_CONFIG, logging_directory: Optional[str]=None,
137
+ listener_timeout=0.5, socket_path=None, *, allow_unauthenticated_remote: bool = False):
138
+ """
139
+ Initializes the tasker service server.
140
+
141
+ :param hostname: Host name to bind. Defaults to the loopback interface; a non-loopback
142
+ address requires an ``authenticator``.
143
+ :param ipv6: True to use IPv6.
144
+ :param port: Port to bind.
145
+ :param authenticator: RPyC authenticator; required for a non-loopback bind.
146
+ :param logging_directory: Optional directory for log files.
147
+ :param socket_path: Optional unix socket path to bind instead of a TCP address.
148
+ :param allow_unauthenticated_remote: Explicit opt-out that allows a non-loopback bind
149
+ without an authenticator (isolated lab networks only).
150
+
151
+ :raises SemanticError: When a non-loopback bind is requested without an authenticator
152
+ and without ``allow_unauthenticated_remote=True``.
153
+ """
154
+
155
+ hostname = resolve_tasker_bind_hostname(hostname, ipv6=ipv6, socket_path=socket_path)
156
+ verify_tasker_bind_is_authenticated(hostname, authenticator, ipv6=ipv6, socket_path=socket_path,
157
+ allow_unauthenticated_remote=allow_unauthenticated_remote)
158
+
159
+ if logging_directory is None:
160
+ logging_directory = tempfile.mkdtemp(prefix=f"taskerserver-{os.getpid()}-")
161
+
162
+ TaskerService.logging_directory = logging_directory
163
+ TaskerService.taskings_log_directory = os.path.join(logging_directory, f"taskings")
164
+
165
+ if not os.path.exists(logging_directory):
166
+ os.makedirs(logging_directory)
167
+
168
+ log_file = os.path.join(logging_directory, 'tasker-server.log')
169
+ log_handler = WatchedFileHandler(log_file)
170
+ logging.basicConfig(format=logging.BASIC_FORMAT, level=logging.DEBUG, handlers=[log_handler])
171
+
172
+ logger = getEnhancedLogger("tasker-server")
173
+
174
+ super().__init__(TaskerService, hostname=hostname, ipv6=ipv6, port=port, backlog=backlog, reuse_addr=reuse_addr,
175
+ authenticator=authenticator, registrar=registrar, auto_register=auto_register,
176
+ protocol_config=protocol_config, logger=logger, listener_timeout=listener_timeout,
177
+ socket_path=socket_path)
178
+
179
+ self._server_thread = None
180
+
181
+ return
182
+
183
+
184
+ def get_service_endpoint(self) -> Tuple[str, int]:
185
+ """
186
+ Return the IP address and port the service is bound to.
187
+
188
+ :returns: Tuple containing the IP address and port number.
189
+ """
190
+ ipaddr, port = self.listener.getsockname()
191
+ return ipaddr, port
192
+
193
+ def start(self):
194
+ """
195
+ Starts the server request accept thread.
196
+ """
197
+ start_gate = threading.Event()
198
+ start_gate.clear()
199
+
200
+ self._server_running = True
201
+
202
+ self._server_thread = threading.Thread(
203
+ target=self._service_thread_entry,
204
+ name="tasker",
205
+ args=(start_gate,),
206
+ daemon=True,
207
+ )
208
+ self._server_thread.start()
209
+
210
+ start_gate.wait()
211
+
212
+ return
213
+
214
+ def serve_forever(self):
215
+ """
216
+ Called when the :class:`TaskerServer` is run from the main thread of
217
+ a service instance.
218
+ """
219
+
220
+ self._service_thread_entry()
221
+
222
+ return
223
+
224
+ def _service_thread_entry(self, start_gate: Optional[threading.Event] = None):
225
+ """
226
+ Internal thread entry point used to run the service.
227
+ """
228
+
229
+ # If we were passed a start_gate, it means a thread is waiting for
230
+ # us to kick off. Set the start_gate to indicate we are running in
231
+ # a new thread
232
+ if start_gate is not None:
233
+ start_gate.set()
234
+
235
+ self.logger.info("Service thread starting ...")
236
+
237
+ self._listen()
238
+ self._register()
239
+ try:
240
+
241
+ while self.active:
242
+ self.accept()
243
+
244
+ except EOFError:
245
+ pass # server closed by another thread
246
+ except KeyboardInterrupt:
247
+ print("")
248
+ self.logger.info("keyboard interrupt!")
249
+ finally:
250
+ self.logger.info("Service thread terminating ...")
251
+ self.close()
252
+
253
+ return
254
+
@@ -19,7 +19,11 @@ from typing import Optional, Tuple
19
19
  import multiprocessing
20
20
  import multiprocessing.managers
21
21
 
22
- from ccai.interop.protocols.tasker.taskerserver import TaskerServer
22
+ from ccai.interop.protocols.tasker.taskerserver import (
23
+ TaskerServer,
24
+ resolve_tasker_bind_hostname,
25
+ verify_tasker_bind_is_authenticated,
26
+ )
23
27
 
24
28
 
25
29
  class TaskerServerManager(multiprocessing.managers.SyncManager):
@@ -32,22 +36,34 @@ class TaskerServerManager(multiprocessing.managers.SyncManager):
32
36
  TaskerServerManager.register("TaskerServer", TaskerServer)
33
37
 
34
38
 
35
- def spawn_tasking_server_process(svc_endpoint: Tuple[str, int], logging_directory: Optional[str] = None) -> Tuple[TaskerServerManager, TaskerServer]:
39
+ def spawn_tasking_server_process(svc_endpoint: Tuple[str, int], logging_directory: Optional[str] = None, *,
40
+ allow_unauthenticated_remote: bool = False) -> Tuple[TaskerServerManager, TaskerServer]:
36
41
  """
37
- Spawns a new :class:`TaskerServer` in a separate process.
42
+ Spawns a new :class:`TaskerServer` in a separate process. The spawned server has no
43
+ authenticator, so ``svc_endpoint`` must be a loopback address unless the caller opts out.
38
44
 
39
45
  :param svc_endpoint: Tuple of IP address and port to bind the server.
40
46
  :param logging_directory: Optional directory for log files.
47
+ :param allow_unauthenticated_remote: Explicit opt-out that allows a non-loopback bind
48
+ without an authenticator (isolated lab networks only).
41
49
 
42
50
  :returns: A tuple containing the manager and the server proxy.
51
+
52
+ :raises SemanticError: When ``svc_endpoint`` is not a loopback address and
53
+ ``allow_unauthenticated_remote`` is not set.
43
54
  """
44
55
 
45
56
  ipaddr, port = svc_endpoint
57
+ ipaddr = resolve_tasker_bind_hostname(ipaddr)
58
+
59
+ # Check in this process, before the manager process is started, so the error reaches the caller
60
+ verify_tasker_bind_is_authenticated(ipaddr, None, allow_unauthenticated_remote=allow_unauthenticated_remote)
46
61
 
47
62
  svr_manager = TaskerServerManager()
48
63
  svr_manager.start()
49
64
 
50
- tasking_svr_proxy = svr_manager.TaskerServer(hostname=ipaddr, port=port, logging_directory=logging_directory)
65
+ tasking_svr_proxy = svr_manager.TaskerServer(hostname=ipaddr, port=port, logging_directory=logging_directory,
66
+ allow_unauthenticated_remote=allow_unauthenticated_remote)
51
67
 
52
68
  return svr_manager, tasking_svr_proxy
53
69
 
@@ -25,7 +25,7 @@ from ccai.interop.protocols.ssh.sshagent import SshAgent
25
25
 
26
26
  if TYPE_CHECKING:
27
27
  from ccai.landscaping.landscape import Landscape
28
- from ccai.landscaping.coordinators.coordinatorbase import CoordinatorBase
28
+ from ccai.landscaping.coordinatorbase import CoordinatorBase
29
29
 
30
30
  class LinuxTaskerClient(ClientBase):
31
31
  """
@@ -1,159 +0,0 @@
1
- """
2
- .. module:: taskerserver
3
- :platform: Darwin, Linux, Unix, Windows
4
- :synopsis: Module containing the :class:`TaskerServer` class which is a host server for the
5
- tasker :class:`TaskerService`.
6
-
7
- .. moduleauthor:: Myron Walker <myron.walker@gmail.com>
8
-
9
- """
10
-
11
- __author__ = "Myron Walker"
12
- __copyright__ = "Copyright 2025, Code Craft AI LLC"
13
- __credits__ = []
14
-
15
-
16
-
17
- from typing import Optional, Tuple
18
-
19
- import os
20
- import socket
21
- import tempfile
22
- import logging
23
- from ccai.xmodules.xlogging.enhancedloggers import getEnhancedLogger
24
- import threading
25
-
26
- from logging.handlers import WatchedFileHandler
27
- from rpyc.utils.server import ThreadedServer
28
-
29
-
30
- from ccai.interop.protocols.tasker.taskerservice import TaskerService
31
-
32
-
33
- TASKER_PROTOCOL_CONFIG = {
34
- "allow_public_attrs": True,
35
- "allow_pickle": True,
36
- "import_custom_exceptions": True,
37
- "allow_custom_exceptions": True,
38
- "sync_request_timeout": 60,
39
- "logger": getEnhancedLogger()
40
- }
41
-
42
- class TaskerServer(ThreadedServer):
43
- """
44
- The :class:`TaskerServer` starts an RPyC server in an internal thread that is capable of handling
45
- requests for tasking.
46
- """
47
-
48
- TASKER_SERVICE_PORT = 8686
49
-
50
-
51
- def __init__(self, hostname=None, ipv6=False, port=TASKER_SERVICE_PORT,
52
- backlog=socket.SOMAXCONN, reuse_addr=True, authenticator=None, registrar=None,
53
- auto_register=None, protocol_config=TASKER_PROTOCOL_CONFIG, logging_directory: Optional[str]=None,
54
- listener_timeout=0.5, socket_path=None):
55
- """
56
- Initializes the tasker service server.
57
-
58
- :param hostname: Host name to bind.
59
- :param ipv6: True to use IPv6.
60
- :param port: Port to bind.
61
- :param logging_directory: Optional directory for log files.
62
- """
63
-
64
- if logging_directory is None:
65
- logging_directory = tempfile.mkdtemp(prefix=f"taskerserver-{os.getpid()}-")
66
-
67
- TaskerService.logging_directory = logging_directory
68
- TaskerService.taskings_log_directory = os.path.join(logging_directory, f"taskings")
69
-
70
- if not os.path.exists(logging_directory):
71
- os.makedirs(logging_directory)
72
-
73
- log_file = os.path.join(logging_directory, 'tasker-server.log')
74
- log_handler = WatchedFileHandler(log_file)
75
- logging.basicConfig(format=logging.BASIC_FORMAT, level=logging.DEBUG, handlers=[log_handler])
76
-
77
- logger = getEnhancedLogger("tasker-server")
78
-
79
- super().__init__(TaskerService, hostname=hostname, ipv6=ipv6, port=port, backlog=backlog, reuse_addr=reuse_addr,
80
- authenticator=authenticator, registrar=registrar, auto_register=auto_register,
81
- protocol_config=protocol_config, logger=logger, listener_timeout=listener_timeout,
82
- socket_path=socket_path)
83
-
84
- self._server_thread = None
85
-
86
- return
87
-
88
-
89
- def get_service_endpoint(self) -> Tuple[str, int]:
90
- """
91
- Return the IP address and port the service is bound to.
92
-
93
- :returns: Tuple containing the IP address and port number.
94
- """
95
- ipaddr, port = self.listener.getsockname()
96
- return ipaddr, port
97
-
98
- def start(self):
99
- """
100
- Starts the server request accept thread.
101
- """
102
- start_gate = threading.Event()
103
- start_gate.clear()
104
-
105
- self._server_running = True
106
-
107
- self._server_thread = threading.Thread(
108
- target=self._service_thread_entry,
109
- name="tasker",
110
- args=(start_gate,),
111
- daemon=True,
112
- )
113
- self._server_thread.start()
114
-
115
- start_gate.wait()
116
-
117
- return
118
-
119
- def serve_forever(self):
120
- """
121
- Called when the :class:`TaskerServer` is run from the main thread of
122
- a service instance.
123
- """
124
-
125
- self._service_thread_entry()
126
-
127
- return
128
-
129
- def _service_thread_entry(self, start_gate: Optional[threading.Event] = None):
130
- """
131
- Internal thread entry point used to run the service.
132
- """
133
-
134
- # If we were passed a start_gate, it means a thread is waiting for
135
- # us to kick off. Set the start_gate to indicate we are running in
136
- # a new thread
137
- if start_gate is not None:
138
- start_gate.set()
139
-
140
- self.logger.info("Service thread starting ...")
141
-
142
- self._listen()
143
- self._register()
144
- try:
145
-
146
- while self.active:
147
- self.accept()
148
-
149
- except EOFError:
150
- pass # server closed by another thread
151
- except KeyboardInterrupt:
152
- print("")
153
- self.logger.info("keyboard interrupt!")
154
- finally:
155
- self.logger.info("Service thread terminating ...")
156
- self.close()
157
-
158
- return
159
-