claude-multiacc 2.0.67 → 2.0.68

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-multiacc",
3
- "version": "2.0.67",
3
+ "version": "2.0.68",
4
4
  "description": "Unified Claude Code and OpenAI Codex subscription pooling with quota-aware selection.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -480,6 +480,7 @@ class ValidatedPublicationTests(RepositoryFixture, unittest.TestCase):
480
480
  self.did_publish = False
481
481
  self.publish_error = False
482
482
  self.registry_existing = None
483
+ self.registry_output = None
483
484
  self.registry_latest = "2.0.65"
484
485
  self.readback_integrity = self.record["artifact"]["integrity"]
485
486
  self.readback_results = []
@@ -506,7 +507,8 @@ class ValidatedPublicationTests(RepositoryFixture, unittest.TestCase):
506
507
  integrity = self.readback_integrity if self.did_publish else self.registry_existing
507
508
  if integrity is None:
508
509
  return 1, "", "npm error code E404"
509
- return 0, json.dumps(integrity), ""
510
+ return 0, (json.dumps(integrity) if self.registry_output is None
511
+ else self.registry_output), ""
510
512
  if argv[:2] == ["npm", "publish"]:
511
513
  self.did_publish = True
512
514
  return (1, "", "publication response lost") if self.publish_error else (0, "published fixture", "")
@@ -616,6 +618,72 @@ class ValidatedPublicationTests(RepositoryFixture, unittest.TestCase):
616
618
  self.assertFalse(self.did_publish)
617
619
  self.assertTrue(any(command[:2] == ["git", "push"] for command in self.commands))
618
620
 
621
+ def test_npm12_existing_singleton_integrity_repairs_tag_without_republishing(self):
622
+ self.registry_existing = [self.record["artifact"]["integrity"]]
623
+ self.registry_latest = "2.0.99"
624
+ result = self.publish()
625
+ self.assertEqual(result["integrity"], self.record["artifact"]["integrity"])
626
+ self.assertFalse(self.did_publish)
627
+ self.assertTrue(any(command[:2] == ["git", "push"] for command in self.commands))
628
+
629
+ def test_npm12_singleton_readback_confirms_exact_new_publication(self):
630
+ self.readback_integrity = [self.record["artifact"]["integrity"]]
631
+ result = self.publish()
632
+ self.assertEqual(result["integrity"], self.record["artifact"]["integrity"])
633
+ self.assertEqual(sum(command[:2] == ["npm", "publish"] for command in self.commands), 1)
634
+ self.assertTrue(any(command[:2] == ["git", "push"] for command in self.commands))
635
+
636
+ def test_npm12_singleton_recovers_a_lost_publish_response(self):
637
+ self.publish_error = True
638
+ self.readback_integrity = [self.record["artifact"]["integrity"]]
639
+ result = self.publish()
640
+ self.assertEqual(result["integrity"], self.record["artifact"]["integrity"])
641
+ self.assertEqual(sum(command[:2] == ["npm", "publish"] for command in self.commands), 1)
642
+ self.assertTrue(any(command[:2] == ["git", "push"] for command in self.commands))
643
+
644
+ def test_npm12_conflicting_singleton_integrity_is_never_republished(self):
645
+ self.registry_existing = ["sha512-another-artifact"]
646
+ with self.assertRaisesRegex(ValueError, "different bytes"):
647
+ self.publish()
648
+ self.assert_not_published_or_tagged()
649
+
650
+ def test_malformed_or_ambiguous_integrity_prevents_publication(self):
651
+ integrity = self.record["artifact"]["integrity"]
652
+ self.registry_existing = integrity
653
+ for value in ([], [integrity, integrity], [integrity, "sha512-other"],
654
+ [[integrity]], [None], [42], {"integrity": integrity},
655
+ None, True, 42, "", [""]):
656
+ with self.subTest(value=value):
657
+ self.commands.clear()
658
+ self.registry_output = json.dumps(value)
659
+ with self.assertRaisesRegex(ValueError, "ambiguous or malformed"):
660
+ self.publish()
661
+ self.assert_not_published_or_tagged()
662
+ for output in ("not-json", '["unterminated"', json.dumps(integrity) + " trailing"):
663
+ with self.subTest(output=output):
664
+ self.commands.clear()
665
+ self.registry_output = output
666
+ with self.assertRaises(ValueError):
667
+ self.publish()
668
+ self.assert_not_published_or_tagged()
669
+
670
+ def test_ambiguous_readback_never_creates_a_tag(self):
671
+ integrity = self.record["artifact"]["integrity"]
672
+ self.readback_integrity = [integrity, integrity]
673
+ with self.assertRaisesRegex(ValueError, "ambiguous or malformed"):
674
+ self.publish()
675
+ self.assertTrue(self.did_publish)
676
+ self.assertFalse(any(command[:2] in (["git", "tag"], ["git", "push"])
677
+ for command in self.commands), self.commands)
678
+
679
+ def test_npm12_mismatched_readback_never_creates_a_tag(self):
680
+ self.readback_integrity = ["sha512-another-artifact"]
681
+ with self.assertRaisesRegex(ValueError, "did not confirm"):
682
+ self.publish()
683
+ self.assertTrue(self.did_publish)
684
+ self.assertFalse(any(command[:2] in (["git", "tag"], ["git", "push"])
685
+ for command in self.commands), self.commands)
686
+
619
687
  def test_lost_publish_response_recovers_only_after_exact_registry_readback(self):
620
688
  self.publish_error = True
621
689
  result = self.publish()