@@ -2523,6 +2523,29 @@ class RealAgentFleetPurePlanningTest(unittest.TestCase):
25232523 trusted project.
25242524 """
25252525
2526+ @staticmethod
2527+ def _stage_sealed_quota_release (root : Path ) -> tuple [Path , Path ]:
2528+ """Stage a self-contained sealed quota-axi release layout under ``root``.
2529+
2530+ ``initial_registry`` otherwise pins the operator machine's installed release,
2531+ which no continuous-integration runner has; the release only has to satisfy the
2532+ sealed-layout and identity checks for this gate, never to execute.
2533+ """
2534+
2535+ entrypoint = root / "node_modules" / "quota-axi" / "dist" / "bin" / "quota-axi.js"
2536+ entrypoint .parent .mkdir (parents = True )
2537+ entrypoint .write_text ("export const fixture = true;\n " , encoding = "utf-8" )
2538+ entrypoint .chmod (0o444 )
2539+ node_binary = root / "runtime" / "node"
2540+ node_binary .parent .mkdir (parents = True )
2541+ node_binary .write_text ("#!/bin/sh\n exit 0\n " , encoding = "utf-8" )
2542+ node_binary .chmod (0o755 )
2543+ quota_binary = root / "bin" / "quota-axi"
2544+ quota_binary .parent .mkdir (parents = True )
2545+ quota_binary .write_text ("#!/bin/sh\n exit 0\n " , encoding = "utf-8" )
2546+ quota_binary .chmod (0o755 )
2547+ return quota_binary , node_binary
2548+
25262549 def test_real_provision_planning_is_pure_for_git_backed_project (self ) -> None :
25272550 pythonpath = SCRIPT_DIR .parents [0 ] / "agent-fleet" / "src"
25282551 init_text = (pythonpath / "agent_fleet" / "__init__.py" ).read_text ("utf-8" )
@@ -2543,13 +2566,19 @@ def test_real_provision_planning_is_pure_for_git_backed_project(self) -> None:
25432566 project = temp / "trusted-project"
25442567 project .mkdir (mode = 0o700 )
25452568 subprocess .run (["git" , "init" , "-q" , str (project )], check = True )
2569+ quota_binary , quota_node_binary = self ._stage_sealed_quota_release (
2570+ temp / "quota-release"
2571+ )
25462572 environment = {
25472573 "AGENT_FLEET_CONFIG" : str (temp / "config" / "accounts.toml" ),
25482574 "AGENT_FLEET_STATE_DIR" : str (temp / "state" ),
25492575 "AGENT_FLEET_SHARE_DIR" : str (temp / "share" ),
2576+ "AGENT_FLEET_QUOTA_BIN" : str (quota_binary ),
2577+ "AGENT_FLEET_QUOTA_NODE_BIN" : str (quota_node_binary ),
25502578 }
25512579 with mock .patch .dict (os .environ , environment ):
25522580 registry = api .config .initial_registry (1 , 1 )
2581+ self .assertEqual (registry .settings .quota_binary , quota_binary )
25532582 providers = dict (registry .providers )
25542583 providers ["claude" ] = dataclasses .replace (
25552584 providers ["claude" ], trusted_projects = (project ,)
0 commit comments