claude-multiacc 2.0.0 → 2.0.2
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.
package/README.md
CHANGED
|
@@ -36,9 +36,12 @@ locked candidate snapshot by usable weekly/session headroom and returns one conc
|
|
|
36
36
|
provider/account plus canonical snapshot and selection digests. `both` is a policy,
|
|
37
37
|
never an execution engine. The caller remains responsible for durable reservations,
|
|
38
38
|
database locks, retries, and launching the selected CLI.
|
|
39
|
+
Successful responses also carry `eligible_count` and `eligible_alternative_count`,
|
|
40
|
+
so callers can persist proof that sole-account reviewer fallback was unavoidable.
|
|
39
41
|
|
|
40
|
-
Run `multiacc-select --version` for the selector protocol version
|
|
41
|
-
version is independent and remains available through
|
|
42
|
+
Run `multiacc-select --version` for the selector protocol version (currently
|
|
43
|
+
`2.0.1`). The npm package version is independent and remains available through
|
|
44
|
+
`claude-multiacc --version`.
|
|
42
45
|
See [the complete selector contract](docs/UNIFIED_SELECTOR.md) for the request fields,
|
|
43
46
|
ranking rules, stable errors, and caller boundary.
|
|
44
47
|
|
|
Binary file
|
|
Binary file
|
package/lib/selector_policy.py
CHANGED
|
@@ -167,6 +167,8 @@ def select(request: object) -> dict:
|
|
|
167
167
|
"session_remaining", "effective_headroom", "last_selected_at")
|
|
168
168
|
response = {"schema": SCHEMA, "selector_version": SELECTOR_VERSION, "ok": True, **chosen,
|
|
169
169
|
"score_basis": {name: winner[name] for name in score_fields},
|
|
170
|
+
"eligible_count": len(eligible),
|
|
171
|
+
"eligible_alternative_count": alternatives,
|
|
170
172
|
"candidate_snapshot_digest": snapshot,
|
|
171
173
|
"selection_digest": canonical_sha256(digest_input)}
|
|
172
174
|
if request["policy"] == "reviewer" and not alternatives and _row_identity(winner) == producer:
|
|
@@ -11,7 +11,7 @@ from datetime import datetime, timezone
|
|
|
11
11
|
from decimal import Decimal, InvalidOperation
|
|
12
12
|
|
|
13
13
|
SCHEMA = "claude-multiacc/pool-selection.v2"
|
|
14
|
-
SELECTOR_VERSION = "2.0.
|
|
14
|
+
SELECTOR_VERSION = "2.0.1"
|
|
15
15
|
TIME_RE = re.compile(
|
|
16
16
|
r"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-5][0-9]"
|
|
17
17
|
r"(\.[0-9]{1,6})?(Z|[+-][0-9]{2}:[0-9]{2})$")
|
package/package.json
CHANGED
package/tests/test_selector.py
CHANGED
|
@@ -54,7 +54,7 @@ class SelectorTests(unittest.TestCase):
|
|
|
54
54
|
"e8ef0b4bc7b95e76231ee6da79616d92bd9251c1c991845c8c0524fcbfb6593a")
|
|
55
55
|
self.assertEqual(
|
|
56
56
|
response["selection_digest"],
|
|
57
|
-
"
|
|
57
|
+
"2c9607e3dc1fde3ddf4e4469fbe48cf0e6a3c8114ef0c6b5f3c82f8ed4f78e3e")
|
|
58
58
|
|
|
59
59
|
def test_unicode_and_active_reservation_proof(self):
|
|
60
60
|
busy = {"active_expires_at": "2026-08-25T09:00:00.000001Z", "last_selected_at": None}
|
|
@@ -68,7 +68,7 @@ class SelectorTests(unittest.TestCase):
|
|
|
68
68
|
"29e8e7d1a611f38ee0be43622102b33875e7ff75ff9024aa43d16151575071d4")
|
|
69
69
|
self.assertEqual(
|
|
70
70
|
response["selection_digest"],
|
|
71
|
-
"
|
|
71
|
+
"2f018ab0e308a8465898e75a867e18d8620c03b4a49109edc1d2d590bf0d1121")
|
|
72
72
|
|
|
73
73
|
def test_both_chooses_each_provider_and_survives_provider_loss(self):
|
|
74
74
|
codex = select(_request([
|
|
@@ -121,7 +121,12 @@ class SelectorTests(unittest.TestCase):
|
|
|
121
121
|
required_engine="claude", producer_identity=producer,
|
|
122
122
|
excluded_identities=[alternative]))
|
|
123
123
|
self.assertEqual((explicit["engine"], review["account_id"]), ("codex", "reviewer"))
|
|
124
|
-
self.assertEqual(
|
|
124
|
+
self.assertEqual(
|
|
125
|
+
(sole["fallback_reason"], sole["eligible_count"],
|
|
126
|
+
sole["eligible_alternative_count"]),
|
|
127
|
+
("sole_eligible_account", 1, 0))
|
|
128
|
+
self.assertEqual(
|
|
129
|
+
(review["eligible_count"], review["eligible_alternative_count"]), (1, 1))
|
|
125
130
|
self.assertEqual((fallback["account_id"], fallback["fallback_reason"]),
|
|
126
131
|
("producer", "sole_eligible_account"))
|
|
127
132
|
|
|
@@ -150,7 +155,7 @@ class SelectorTests(unittest.TestCase):
|
|
|
150
155
|
self.assertEqual(overflow_seen["error_code"], "no_candidate")
|
|
151
156
|
self.assertEqual(overflow_history["error_detail"], {
|
|
152
157
|
"field": "candidates[0].reservation_history.active_expires_at"})
|
|
153
|
-
self.assertEqual(invalid, {"schema": SCHEMA, "selector_version": "2.0.
|
|
158
|
+
self.assertEqual(invalid, {"schema": SCHEMA, "selector_version": "2.0.1", "ok": False,
|
|
154
159
|
"error_code": "invalid_request", "error_detail": {"field": "$"}})
|
|
155
160
|
|
|
156
161
|
def test_rfc8785_digest_vectors(self):
|
|
@@ -201,7 +206,7 @@ class SelectorTests(unittest.TestCase):
|
|
|
201
206
|
self.assertTrue(all(json.loads(item.stdout)["error_code"] == "invalid_request"
|
|
202
207
|
for item in bad))
|
|
203
208
|
self.assertEqual(json.loads(decimal_response.stdout)["account_id"], "z-lower")
|
|
204
|
-
self.assertEqual(version, "2.0.
|
|
209
|
+
self.assertEqual(version, "2.0.1")
|
|
205
210
|
self.assertEqual(versions, ["2.0.0", "2.0.1"])
|
|
206
211
|
|
|
207
212
|
|