Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 250,000+ scientists worldwide. 177 ready-to-use validated skills plus 100+ scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard.
Python agent-skillsai-scientistbioinformaticschemoinformaticsclaudeclaude-skillsclaudecodeclinical-researchcomputational-biologydata-analysisdrug-discoverygenomicsmaterials-sciencemetabolomicsproteomicsscientific-computingscientific-visualization
fix(arbor): reject invalid evidence statuses before updating state
Timothy Kassis203bcce5d267
diff --git a/skills/arbor/SKILL.md b/skills/arbor/SKILL.mdindex a04a2459..8e57ea09 100644--- a/skills/arbor/SKILL.md+++ b/skills/arbor/SKILL.md@@ -4,7 +4,7 @@ description: Autonomously improve a real artifact (code, training recipe, agentallowed-tools: Read Write Edit Bash Agentlicense: MIT licensemetadata:- version: "1.3"+ version: "1.4"skill-author: K-Dense Inc.---diff --git a/skills/arbor/scripts/tree.py b/skills/arbor/scripts/tree.pyindex fc49274d..05e85c0d 100644--- a/skills/arbor/scripts/tree.py+++ b/skills/arbor/scripts/tree.py@@ -211,6 +211,8 @@ def cmd_set_evidence(args):leaf part). Insight propagation upward is a separate, deliberate call."""tree = _load_tree(args.run_dir)node = _node(tree, args.node)+ if args.status is not None and args.status not in VALID_STATUS:+ sys.exit(f"error: status must be one of {sorted(VALID_STATUS)}")meta = node["metadata"]if args.dev_score is not None:meta["dev_score"] = args.dev_score@@ -523,7 +525,7 @@ def build_parser():s.add_argument("--result", default=None, help="Factual result summary")s.add_argument("--insight", default=None, help="Distilled, reusable lesson from this experiment")s.add_argument("--branch-ref", default=None, help="Git branch/commit/worktree path of the artifact")- s.add_argument("--status", default=None, help="Override status (default: executed)")+ s.add_argument("--status", default=None, help=f"Override status (default: executed), one of {sorted(VALID_STATUS)}")s.set_defaults(func=cmd_set_evidence)s = sub.add_parser("propagate", help="Abstract a leaf insight up to ancestors (Backpropagate, upward)")diff --git a/tests/arbor/test_scripts.py b/tests/arbor/test_scripts.pyindex 5334c01c..5b405759 100644--- a/tests/arbor/test_scripts.py+++ b/tests/arbor/test_scripts.py@@ -202,6 +202,30 @@ class EvidenceTests(ArborRunTestCase):)self.assertEqual(self.tree["nodes"]["n2"]["status"], "pruned")+ def test_invalid_evidence_status_leaves_all_persisted_state_unchanged(self) -> None:+ self.run_command("set-evidence", "--node", "n2", "--dev-score", "0.4",+ "--result", "original result")+ state_path = self.run_dir / ".arbor" / "tree.json"+ before = state_path.read_bytes()+ for status in ("inprogress", ""):+ with self.subTest(status=status):+ with self.assertRaisesRegex(SystemExit, "status must be one of"):+ self.run_command(+ "set-evidence", "--node", "n2", "--dev-score", "0.9",+ "--result", "replacement", "--insight", "new lesson",+ "--branch-ref", "new-branch", "--status", status,+ )+ self.assertEqual(state_path.read_bytes(), before)+ out, _ = self.run_command("observe")+ self.assertIn("n2 [executed]", out)+ self.run_command("validate")++ def test_set_evidence_accepts_every_supported_status(self) -> None:+ for status in sorted(arbor_tree.VALID_STATUS):+ with self.subTest(status=status):+ self.run_command("set-evidence", "--node", "n2", "--status", status)+ self.assertEqual(self.tree["nodes"]["n2"]["status"], status)+def test_a_partial_update_leaves_untouched_fields_alone(self) -> None:self.run_command("set-evidence",