Disclaimer: Grammar, punctuation, and word choice has been adjusted somewhat but expect some areas that are not polished.

Harbor Guard

This tech, once acquired, allows an empire to (nearly) permanently assign select military ships to system defense.
This allows you to convert a navy (military) ship by removing the ability to leave the hex- the ship is essentially treated as a national guard unit. The number of harbor ships cannot exceed the CAN of the orbital bases present. Normal CAN limits of a SQ still apply (i.e., the (D17.0) rules apply). These squadrons are exempt from reductions due to CAN-3 (B1.110), CAN-4 (B1.115), and CAN-5 (B1.120). They don't need to pay for this exemption via (B1.130).

Each ship so converted provides a one time income of 20% of the EPV of the ship (assume no surcharges nor discounts). Any number of military ships can be converted in a turn. Reversing the process to make the ship a normal space worthy vessel again can be done at a rate of 2 ships/turn, and it costs 2xEPV. While in harbor guard mode the AF/DF of the units is decreased by 20%.

Examples:
If the system has a single MB in orbit, a single squadron of 6 slots [see (D17.0)]. If it had a SB and a MB, it could have two squadrons- one with 6 slots (controlled by the MB) and a second one with 10 (controlled by the SB).
If the empire had EFO (D17.25), and a MB, it could convert and assign 9xFF to Harbor Guard duty. Assigning 2xCC to the same squadron would be illegal (D17.40)
MB(HBM, 6xFTR, 9xFF)

This tech is only available after a successful R&D program (D1.0). It is available starting in Y100.