Hello-QM/catgo-LRG / server/catgo/workflow/skills/campaign
campaign-md-orchestration
VerifiedDrive a file-first, agent-in-the-loop computational campaign via a folder + markdown tree (no DB). Use when the user opts out of the visual workflow engine.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.2 KB |
| references/catgo-cli.md | markdown | 1.8 KB |
| scripts/INDEX.md | markdown | 1.8 KB |
| scripts/aggregate.py | script | 1011 B |
| scripts/archive.py | script | 1.8 KB |
| scripts/campaign_analysis.py | script | 4.3 KB |
| scripts/campaign_lib.py | script | 24.5 KB |
| scripts/campaign_lit.py | script | 3.3 KB |
| scripts/campaign_report.py | script | 1.6 KB |
| scripts/fetch_ref.py | script | 943 B |
| scripts/ingest_lit.py | script | 1.3 KB |
| scripts/make_report.py | script | 880 B |
| scripts/new_campaign.py | script | 932 B |
| scripts/poll.py | script | 798 B |
| scripts/submit_calc.py | script | 1.6 KB |
| scripts/test_campaign_analysis.py | script | 3.7 KB |
| scripts/test_campaign_lib.py | script | 21.8 KB |
| scripts/test_campaign_lit.py | script | 2.0 KB |
| scripts/test_campaign_report.py | script | 1.4 KB |
| scripts/test_entrypoints.py | script | 2.7 KB |
| scripts/test_skill_structure.py | script | 1.8 KB |
| scripts/test_vasp_sanity.py | script | 9.6 KB |
| scripts/vasp_sanity.py | script | 12.5 KB |
| templates/saa_her/plan.md | markdown | 1009 B |
scripts/test_campaign_analysis.py
View on GitHub"""campaign_analysis — cross-calc aggregation (ranking / volcano / funnel)."""
import campaign_lib as cl
import campaign_analysis as ca
def _project_with_results(tmp_path):
root = cl.scaffold_project(tmp_path / "SAA-HER", "SAA HER", template="saa_her")
data = {
"Pt1-Cu_SAA": {"E_form": -0.42, "dG_H": 0.08},
"Ni1-Cu_SAA": {"E_form": -0.10, "dG_H": -0.30},
"Au1-Cu_SAA": {"E_form": 0.25, "dG_H": 0.02}, # unstable (E_form > 0)
}
for name, vals in data.items():
d = root / "calc" / "01-stability-formation-energy" / name
d.mkdir(parents=True)
(d / "result.md").write_text(cl.render_result(name, vals))
return root
def test_collect_results_reads_all_with_stage_and_name(tmp_path):
root = _project_with_results(tmp_path)
results = ca.collect_results(str(root))
assert len(results) == 3
names = {r["name"] for r in results}
assert names == {"Pt1-Cu_SAA", "Ni1-Cu_SAA", "Au1-Cu_SAA"}
assert all(r["stage"] == "01-stability-formation-energy" for r in results)
pt = next(r for r in results if r["name"] == "Pt1-Cu_SAA")
assert pt["values"]["E_form"] == -0.42
def test_rank_formation_energy_sorts_most_stable_first(tmp_path):
root = _project_with_results(tmp_path)
md, csv = ca.rank_formation_energy(ca.collect_results(str(root)))
# most negative E_form ranked first
assert md.index("Pt1-Cu_SAA") < md.index("Ni1-Cu_SAA") < md.index("Au1-Cu_SAA")
assert csv.startswith("rank,candidate,E_form")
assert "1,Pt1-Cu_SAA" in csv
def test_volcano_csv_sorted_by_abs_dG(tmp_path):
root = _project_with_results(tmp_path)
csv = ca.volcano_csv(ca.collect_results(str(root)))
assert csv.startswith("candidate,dG_H,abs_dG_H")
body = csv.strip().splitlines()[1:]
# Au (|0.02|) before Pt (|0.08|) before Ni (|0.30|)
assert body[0].startswith("Au1-Cu_SAA")
assert body[-1].startswith("Ni1-Cu_SAA")
def test_funnel_counts_survivors(tmp_path):
root = _project_with_results(tmp_path)
md = ca.funnel_md(ca.collect_results(str(root)), eform_threshold=0.0, top=2)
assert "3 candidates" in md
# only Pt and Ni have E_form < 0
assert "2" in md and "Pt1-Cu_SAA" in md and "Ni1-Cu_SAA" in md
assert "Au1-Cu_SAA" not in md.split("survivors")[1].split("stage 2")[0]
def test_write_aggregates_creates_files(tmp_path):
root = _project_with_results(tmp_path)
info = ca.write_aggregates(str(root), eform_threshold=0.0, top=2)
assert info["n_results"] == 3
adir = root / "analysis"
for f in ("formation_energy_ranking.md", "formation_energy_ranking.csv",
"volcano.csv", "funnel.md"):
assert (adir / f).is_file(), f"missing {f}"
def test_volcano_plot_writes_png(tmp_path):
root = _project_with_results(tmp_path)
dest = ca.volcano_plot(str(root))
assert dest.is_file()
assert dest.suffix == ".png"
assert dest.stat().st_size > 0
def test_nan_results_excluded_from_aggregates(tmp_path):
# a failed job writing `dG_H: nan` must not silently scramble ordering
root = cl.scaffold_project(tmp_path / "p", "p", template="saa_her")
d = root / "calc" / "01-stability-formation-energy"
for name, vals in (("good", {"E_form": -0.3, "dG_H": 0.05}),
("failed", {"E_form": float("nan"), "dG_H": float("nan")})):
(d / name).mkdir(parents=True)
(d / name / "result.md").write_text(cl.render_result(name, vals))
results = ca.collect_results(str(root))
md, csv = ca.rank_formation_energy(results)
assert "good" in md and "failed" not in md # nan row dropped
assert "1 candidates" in md
funnel = ca.funnel_md(results)
assert "1 candidates" in funnel # only the finite one counts
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |