pbg-superpowers 0.2.0__tar.gz

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.
Files changed (104) hide show
  1. pbg_superpowers-0.2.0/.github/workflows/plugin-ci.yml +34 -0
  2. pbg_superpowers-0.2.0/.github/workflows/release.yml +37 -0
  3. pbg_superpowers-0.2.0/.gitignore +9 -0
  4. pbg_superpowers-0.2.0/PKG-INFO +13 -0
  5. pbg_superpowers-0.2.0/README.md +105 -0
  6. pbg_superpowers-0.2.0/docs/audits/pbg-pypi-audit-2026-05-11.md +278 -0
  7. pbg_superpowers-0.2.0/docs/conventions/composites.md +198 -0
  8. pbg_superpowers-0.2.0/docs/conventions/discovery.md +337 -0
  9. pbg_superpowers-0.2.0/docs/conventions/distribution.md +110 -0
  10. pbg_superpowers-0.2.0/docs/conventions/visualizations.md +73 -0
  11. pbg_superpowers-0.2.0/pbg_superpowers/__init__.py +2 -0
  12. pbg_superpowers-0.2.0/pbg_superpowers/_resources.py +31 -0
  13. pbg_superpowers-0.2.0/pbg_superpowers/composite_discovery.py +91 -0
  14. pbg_superpowers-0.2.0/pbg_superpowers/composite_spec.py +163 -0
  15. pbg_superpowers-0.2.0/pbg_superpowers/core_introspection.py +44 -0
  16. pbg_superpowers-0.2.0/pbg_superpowers/imports.py +65 -0
  17. pbg_superpowers-0.2.0/pbg_superpowers/package_audit.py +252 -0
  18. pbg_superpowers-0.2.0/pbg_superpowers/phase_files.py +79 -0
  19. pbg_superpowers-0.2.0/pbg_superpowers/phase_gate.py +57 -0
  20. pbg_superpowers-0.2.0/pbg_superpowers/phase_md.py +46 -0
  21. pbg_superpowers-0.2.0/pbg_superpowers/report.py +81 -0
  22. pbg_superpowers-0.2.0/pbg_superpowers/scaffold.py +237 -0
  23. pbg_superpowers-0.2.0/pbg_superpowers/schemas/composite-spec.schema.json +30 -0
  24. pbg_superpowers-0.2.0/pbg_superpowers/schemas/phase.schema.json +47 -0
  25. pbg_superpowers-0.2.0/pbg_superpowers/schemas/workspace.schema.json +253 -0
  26. pbg_superpowers-0.2.0/pbg_superpowers/visualization.py +84 -0
  27. pbg_superpowers-0.2.0/pbg_superpowers/workspace_yaml.py +39 -0
  28. pbg_superpowers-0.2.0/plugin.yaml +46 -0
  29. pbg_superpowers-0.2.0/pyproject.toml +34 -0
  30. pbg_superpowers-0.2.0/scripts/audit-pbg-catalog.py +217 -0
  31. pbg_superpowers-0.2.0/server/.keep +0 -0
  32. pbg_superpowers-0.2.0/server/client.js +60 -0
  33. pbg_superpowers-0.2.0/server/server.py +139 -0
  34. pbg_superpowers-0.2.0/server/start-server.sh +29 -0
  35. pbg_superpowers-0.2.0/skills/.keep +0 -0
  36. pbg_superpowers-0.2.0/skills/pbg-composer/SKILL.md +70 -0
  37. pbg_superpowers-0.2.0/skills/pbg-expert/SKILL.md +1139 -0
  38. pbg_superpowers-0.2.0/skills/pbg-package/SKILL.md +68 -0
  39. pbg_superpowers-0.2.0/skills/pbg-phase/SKILL.md +64 -0
  40. pbg_superpowers-0.2.0/skills/pbg-report/SKILL.md +49 -0
  41. pbg_superpowers-0.2.0/skills/pbg-server/SKILL.md +46 -0
  42. pbg_superpowers-0.2.0/skills/pbg-suggest/SKILL.md +59 -0
  43. pbg_superpowers-0.2.0/skills/pbg-viz/SKILL.md +122 -0
  44. pbg_superpowers-0.2.0/skills/pbg-workspace/SKILL.md +50 -0
  45. pbg_superpowers-0.2.0/skills/pbg-wrapper/SKILL.md +64 -0
  46. pbg_superpowers-0.2.0/templates/.keep +0 -0
  47. pbg_superpowers-0.2.0/templates/_assets/render-helpers.js +30 -0
  48. pbg_superpowers-0.2.0/templates/_assets/style.css +31 -0
  49. pbg_superpowers-0.2.0/templates/model/.github/workflows/model-ci.yml +24 -0
  50. pbg_superpowers-0.2.0/templates/model/.gitignore +5 -0
  51. pbg_superpowers-0.2.0/templates/model/README.md.j2 +11 -0
  52. pbg_superpowers-0.2.0/templates/model/pbg_<model>/__init__.py.j2 +1 -0
  53. pbg_superpowers-0.2.0/templates/model/pbg_<model>/adapters.py +1 -0
  54. pbg_superpowers-0.2.0/templates/model/pbg_<model>/core.py.j2 +11 -0
  55. pbg_superpowers-0.2.0/templates/model/pbg_<model>/document.py.j2 +7 -0
  56. pbg_superpowers-0.2.0/templates/model/pbg_<model>/stubs.py +1 -0
  57. pbg_superpowers-0.2.0/templates/model/pbg_<model>/types.py +1 -0
  58. pbg_superpowers-0.2.0/templates/model/pbg_<model>/wiring.py.j2 +2 -0
  59. pbg_superpowers-0.2.0/templates/model/phases/deliverables/.keep +0 -0
  60. pbg_superpowers-0.2.0/templates/model/phases/plan.md.j2 +10 -0
  61. pbg_superpowers-0.2.0/templates/model/pyproject.toml.j2 +19 -0
  62. pbg_superpowers-0.2.0/templates/model/reports/assets/.keep +0 -0
  63. pbg_superpowers-0.2.0/templates/model/reports/index.html.j2 +54 -0
  64. pbg_superpowers-0.2.0/templates/model/tests/__init__.py +0 -0
  65. pbg_superpowers-0.2.0/templates/model/tests/registry-snapshot.json.j2 +1 -0
  66. pbg_superpowers-0.2.0/templates/model/tests/test_adapters.py +1 -0
  67. pbg_superpowers-0.2.0/templates/model/tests/test_assembly.py.j2 +6 -0
  68. pbg_superpowers-0.2.0/templates/model/tests/test_core_integration.py.j2 +72 -0
  69. pbg_superpowers-0.2.0/templates/model/tests/test_run.py.j2 +1 -0
  70. pbg_superpowers-0.2.0/templates/workspace/reports/index.html.j2 +29 -0
  71. pbg_superpowers-0.2.0/tests/__init__.py +0 -0
  72. pbg_superpowers-0.2.0/tests/conftest.py +18 -0
  73. pbg_superpowers-0.2.0/tests/fixtures/.keep +0 -0
  74. pbg_superpowers-0.2.0/tests/fixtures/composites/baseline.composite.json +50 -0
  75. pbg_superpowers-0.2.0/tests/fixtures/composites/baseline.composite.yaml +37 -0
  76. pbg_superpowers-0.2.0/tests/fixtures/pbg-fake-tool/pbg_fake_tool/__init__.py +6 -0
  77. pbg_superpowers-0.2.0/tests/fixtures/pbg-fake-tool/pbg_fake_tool/processes.py +23 -0
  78. pbg_superpowers-0.2.0/tests/fixtures/pbg-fake-tool/pyproject.toml +11 -0
  79. pbg_superpowers-0.2.0/tests/fixtures/pbg-fake-tool/tests/test_fake.py +6 -0
  80. pbg_superpowers-0.2.0/tests/fixtures/phases/phase-1-planned.md +20 -0
  81. pbg_superpowers-0.2.0/tests/fixtures/phases/phase-2-in_progress.md +26 -0
  82. pbg_superpowers-0.2.0/tests/fixtures/phases/phase-3-gate_pending.md +25 -0
  83. pbg_superpowers-0.2.0/tests/fixtures/workspace-baseline/MANIFEST.txt +54 -0
  84. pbg_superpowers-0.2.0/tests/test_composite_spec.py +147 -0
  85. pbg_superpowers-0.2.0/tests/test_core_introspection.py +65 -0
  86. pbg_superpowers-0.2.0/tests/test_discovery_contract.py +227 -0
  87. pbg_superpowers-0.2.0/tests/test_e2e_happy_path.py +200 -0
  88. pbg_superpowers-0.2.0/tests/test_failure_modes.py +68 -0
  89. pbg_superpowers-0.2.0/tests/test_import_model_command.py +114 -0
  90. pbg_superpowers-0.2.0/tests/test_imports.py +87 -0
  91. pbg_superpowers-0.2.0/tests/test_model_scaffold.py +66 -0
  92. pbg_superpowers-0.2.0/tests/test_package_audit.py +173 -0
  93. pbg_superpowers-0.2.0/tests/test_phase_files.py +47 -0
  94. pbg_superpowers-0.2.0/tests/test_phase_frontmatter_schema.py +55 -0
  95. pbg_superpowers-0.2.0/tests/test_phase_gate.py +56 -0
  96. pbg_superpowers-0.2.0/tests/test_phase_md.py +68 -0
  97. pbg_superpowers-0.2.0/tests/test_report_render.py +79 -0
  98. pbg_superpowers-0.2.0/tests/test_server_lifecycle.py +96 -0
  99. pbg_superpowers-0.2.0/tests/test_skill_manifests.py +50 -0
  100. pbg_superpowers-0.2.0/tests/test_visualization.py +120 -0
  101. pbg_superpowers-0.2.0/tests/test_workspace_scaffold.py +76 -0
  102. pbg_superpowers-0.2.0/tests/test_workspace_scaffold_snapshot.py +43 -0
  103. pbg_superpowers-0.2.0/tests/test_workspace_yaml_io.py +43 -0
  104. pbg_superpowers-0.2.0/tests/test_workspace_yaml_schema.py +345 -0
@@ -0,0 +1,34 @@
1
+ name: plugin-ci
2
+ on: [push, pull_request]
3
+
4
+ jobs:
5
+ test:
6
+ runs-on: ${{ matrix.os }}
7
+ strategy:
8
+ matrix:
9
+ os: [ubuntu-latest, macos-latest]
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: actions/setup-python@v5
13
+ with:
14
+ python-version: "3.11"
15
+ - name: Install uv
16
+ run: pip install uv
17
+ - name: Set up venv and install plugin
18
+ run: |
19
+ uv venv .venv
20
+ source .venv/bin/activate
21
+ uv pip install -e .[dev]
22
+ - name: Run L1 tests
23
+ env:
24
+ # The integration tests skip cleanly when ~/code/pbg-template isn't
25
+ # present, but in CI we want to actually run them. Clone the template
26
+ # to the expected path before pytest collects.
27
+ PBG_TEMPLATE_REPO: https://github.com/vivarium-collective/pbg-template.git
28
+ run: |
29
+ mkdir -p ~/code
30
+ if [ ! -d ~/code/pbg-template ]; then
31
+ git clone --depth 1 "$PBG_TEMPLATE_REPO" ~/code/pbg-template || true
32
+ fi
33
+ source .venv/bin/activate
34
+ pytest -v
@@ -0,0 +1,37 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+ environment: release
12
+ permissions:
13
+ id-token: write
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Set up uv and Python
18
+ uses: astral-sh/setup-uv@v5
19
+ with:
20
+ python-version: '3.12'
21
+ enable-cache: true
22
+ cache-dependency-glob: "**/uv.lock"
23
+
24
+ - name: Verify tag matches pyproject version
25
+ run: |
26
+ tag_version="${GITHUB_REF_NAME#v}"
27
+ pyproject_version=$(uv version --short)
28
+ if [ "$tag_version" != "$pyproject_version" ]; then
29
+ echo "Tag version ($tag_version) does not match pyproject.toml version ($pyproject_version)"
30
+ exit 1
31
+ fi
32
+
33
+ - name: Build distributions
34
+ run: uv build
35
+
36
+ - name: Publish to PyPI via trusted publisher
37
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,9 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ *.pyc
7
+ .pytest_cache/
8
+ .coverage
9
+ htmlcov/
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: pbg-superpowers
3
+ Version: 0.2.0
4
+ Summary: Plugin Python helpers for the pbg-superpowers skills
5
+ Requires-Python: >=3.11
6
+ Requires-Dist: click>=8.1
7
+ Requires-Dist: jinja2>=3.1
8
+ Requires-Dist: jsonschema[format-nongpl]>=4.21
9
+ Requires-Dist: pyyaml>=6.0
10
+ Provides-Extra: dev
11
+ Requires-Dist: pytest-cov>=4.1; extra == 'dev'
12
+ Requires-Dist: pytest-timeout>=2.1; extra == 'dev'
13
+ Requires-Dist: pytest>=7.4; extra == 'dev'
@@ -0,0 +1,105 @@
1
+ # pbg-superpowers
2
+
3
+ > **🚧 In development.** This plugin is evolving rapidly. The skills marked **Stable** below
4
+ > are usable today; the rest (workspace bootstrap, dashboard, phases, visualization codegen,
5
+ > package audit) are under active iteration and may change shape between minor versions.
6
+
7
+ A Claude Code plugin for building **process-bigraph research projects**.
8
+ Scaffold a workspace, walk a canonical PR flow, plan multi-phase model
9
+ extensions, and produce interactive HTML reports.
10
+
11
+ ## Install
12
+
13
+ (inside Claude Code:)
14
+
15
+ /plugin install pbg-superpowers
16
+ /reload-plugins
17
+
18
+ ## Quick start
19
+
20
+ Wrap a simulator as a standalone pbg-* package:
21
+
22
+ /pbg-expert tellurium
23
+
24
+ Or wrap it lightly inside an existing workspace:
25
+
26
+ cd ~/code/my-workspace
27
+ /pbg-wrapper tellurium
28
+
29
+ Compose multiple wrappers:
30
+
31
+ /pbg-expert metabolism cobra tellurium # heavy: new sibling composite repo
32
+ /pbg-composer metabolism cobra tellurium # light: inside current workspace
33
+
34
+ The workspace-bootstrap + dashboard skills (`/pbg-workspace`, `/pbg-server`,
35
+ `/pbg-report`, `/pbg-phase`, `/pbg-viz`, `/pbg-package`) are still in development
36
+ — see the table above.
37
+
38
+ ## Two repos
39
+
40
+ This plugin works with a sibling repo, [`pbg-template`](https://github.com/vivarium-collective/pbg-template),
41
+ which `/pbg-workspace` clones to scaffold new workspaces. You can also use
42
+ `pbg-template` directly via GitHub's "Use this template" button — the
43
+ `template-init.sh` in that repo produces the same structure without
44
+ requiring this plugin.
45
+
46
+ ## Skills
47
+
48
+ ### Stable — recommended for current use
49
+
50
+ | Skill | Repo target | What it does |
51
+ |---|---|---|
52
+ | `/pbg-expert <tool>` | new `pbg-<tool>/` sibling | Wrap a simulator as a process-bigraph Process: scaffolds a full sibling repo with Process class, tests, README, HTML report, and an open PR. The heavy/canonical wrap. |
53
+ | `/pbg-expert <name> <tools…>` | new `pbg-<name>-composite/` sibling | Compose two or more wrapped simulators into a sibling composite repo, with HTML report and PR. Same heavy flow as the single-tool form. |
54
+ | `/pbg-wrapper <tool>` | current workspace | Lightweight in-workspace wrap. Writes `pbg_<slug>/processes/<tool>.py` + a test stub. No sibling repo, no report — good for incremental experimentation. |
55
+ | `/pbg-composer <name> <tools…>` | current workspace | Lightweight in-workspace composite. Writes `pbg_<slug>/composites/<name>.py` + test stub referencing already-installed wrapper packages. |
56
+ | `/pbg-suggest <request-id>` | current workspace | Draft a Claude-suggested repo name, PR title, or PR body in response to a dashboard Suggest button request. Writes the response to `.pbg/agent-responses/<id>.json`; dashboard polls and fills the input automatically. |
57
+
58
+ ### In development
59
+
60
+ These ship today but their interfaces are still moving:
61
+
62
+ | Skill | What it does |
63
+ |---|---|
64
+ | `/pbg-workspace <name>` | Scaffold a workspace by cloning pbg-template |
65
+ | `/pbg-server [start\|stop\|status]` | Local dashboard (5 tabs + workstream strip + branch timeline) |
66
+ | `/pbg-report` | Regenerate `reports/index.html` after manual state changes |
67
+ | `/pbg-phase <n>` | Drive phase n inside a workspace |
68
+ | `/pbg-viz <name>` | Generate a `Visualization` subclass from a description (v0.4.11+: class form, auto-discoverable) |
69
+ | `/pbg-package <repo>` | Audit a pbg-* repo for discovery-convention compliance |
70
+
71
+ ## Architecture
72
+
73
+ - **Workspace IS the model.** The workspace root contains `pbg_<slug>/`, `tests/`, `phases/`, and `workspace.yaml` directly. The workspace owns datasets, references, decision log, and the dashboard.
74
+ - **5-tab dashboard.** `Workspace inputs · Registry · Simulation Setup · Visualizations · Build Model`. Each tab is the canonical UI for that part of the workflow. Skills are the alternative for code-writing tasks that benefit from Claude.
75
+ - **Active-branch workstream model.** Click *Start workstream* in the sticky strip below the menu; every dashboard mutation commits to that branch. *Push* + *Create PR* one-click via the strip. One PR per workstream, many commits — co-workers review the whole accumulated change in one place.
76
+ - **Registry as catalog.** `scripts/_catalog/modules.json` lists curated pbg-* packages. Install adds a submodule, pip-installs into `.venv`, and appends to `pyproject.toml` `[project.dependencies]`. The Discovered Processes/Types tables read live from `bigraph_schema.package.discover` — no manual `register_link()` boilerplate needed. See [docs/conventions/discovery.md](docs/conventions/discovery.md).
77
+ - **Visualization-as-description.** A visualization is `{name, description}` in `workspace.yaml`. Create writes a request file; `/pbg-viz <name>` generates a `Visualization` subclass (auto-discoverable via bigraph-schema) with a `_demo()` helper; Add to project stages it; Commit lands `pbg_<slug>/visualizations/<name>.py` on the active branch.
78
+ - **Phase template is first-class.** Each phase lives in `phases/phase-N.md` at the workspace root with YAML frontmatter (`status`, `prereq_phases`, `gate_passed`, `acceptance_tests`, …). The body uses your Phase Template format verbatim. The Build Model tab renders each phase with a Start phase / Evaluate gate action button.
79
+ - **Composite spec convention.** Composites are DATA, not code. Any `*.composite.yaml` or `*.composite.json` file in an installed bigraph-schema-dependent package is a composite spec — a declarative state document with optional typed parameters that support `${name}` substitution. `pbg_superpowers.composite_spec.build_composite_from_spec` turns a parsed spec into a runnable `Composite`; `pbg_superpowers.composite_discovery.discover_composites` walks all installed packages (and optional local search paths) to find every registered spec without importing any simulator code. See [docs/conventions/composites.md](docs/conventions/composites.md) for the full reference.
80
+ - **Visualization Step base class** — `pbg_superpowers.visualization.Visualization`
81
+ is a `process_bigraph.Step` subclass; visualization subclasses are
82
+ auto-discovered alongside Processes / Emitters / Types. See
83
+ [docs/conventions/visualizations.md](docs/conventions/visualizations.md).
84
+
85
+ ## Tests
86
+
87
+ Three levels:
88
+
89
+ - **L1 (plugin internals)** — `pytest` from this repo
90
+ - **L2 (workspace lint)** — `python scripts/lint-workspace.py` inside any scaffolded workspace
91
+ - **L3 (workspace tests)** — `pytest tests/` from the workspace root, including `test_core_integration.py` (process/type registry checks + drift detector) and `test_phases.py` (auto-generated from phase frontmatter)
92
+
93
+ CI workflows are provided for both repos:
94
+
95
+ - `.github/workflows/plugin-ci.yml` (this repo)
96
+ - `.github/workflows/workspace-ci.yml` (in scaffolded workspaces, via `pbg-template`)
97
+
98
+ ## Design
99
+
100
+ See `docs/superpowers/specs/2026-05-09-pbg-project-template-design.md`
101
+ in the brainstorming repo for the full architectural spec.
102
+
103
+ ## License
104
+
105
+ MIT (or your-license-here).
@@ -0,0 +1,278 @@
1
+ # pbg-* PyPI publication audit (2026-05-11)
2
+
3
+ Generated by `scripts/audit-pbg-catalog.py`. Run periodically to track
4
+ progress toward full PyPI publication of the catalog.
5
+
6
+ Catalog: `/Users/eranagmon/code/pbg-template/scripts/_catalog/modules.json`
7
+ Entries audited: 18
8
+
9
+ ## Summary
10
+
11
+ | Repo | pyproject | bigraph-schema | process-bigraph | requires-python | Process subclasses | Published on PyPI |
12
+ | --- | --- | --- | --- | --- | --- | --- |
13
+ | pbg-bioreactordesign | PASS | PASS | PASS | PASS | PASS (1:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
14
+ | pbg-caspule | PASS | PASS | PASS | PASS | PASS (1:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
15
+ | pbg-cellpack | PASS | PASS | PASS | PASS | PASS (1:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
16
+ | pbg-comets | PASS | PASS | PASS | PASS | PASS (3:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
17
+ | pbg-composite-nfsim-caspule | PASS | PASS | PASS | PASS | PASS (1:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
18
+ | pbg-compucell3d | PASS | PASS | PASS | PASS | PASS (1:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
19
+ | pbg-lammps | PASS | PASS | PASS | PASS | PASS (1:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
20
+ | pbg-martini | PASS | PASS | PASS | PASS | PASS (5:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
21
+ | pbg-medyan | PASS | PASS | PASS | PASS | PASS (2:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
22
+ | pbg-mem3dg | PASS | PASS | PASS | PASS | PASS (1:) | PASS — published on PyPI as pbg-mem3dg (latest: 0.1.0) |
23
+ | pbg-nfsim | PASS | PASS | PASS | PASS | PASS (2:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
24
+ | pbg-readdy | PASS | PASS | PASS | PASS | PASS (1:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
25
+ | pbg-smoldyn | PASS | PASS | PASS | PASS | PASS (1:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
26
+ | pbg-tellurium | PASS | PASS | PASS | PASS | PASS (2:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
27
+ | pbg-vcell-fvsolver | PASS | PASS | PASS | PASS | PASS (1:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
28
+ | pbg-yalla | PASS | PASS | PASS | PASS | PASS (1:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
29
+ | spatio-flux | PASS | PASS | PASS | PASS | PASS (13:) | PASS — published on PyPI as spatio-flux (latest: 1.3.0) |
30
+ | v2ecoli | PASS | PASS | PASS | PASS | PASS (49:) | WARN — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md |
31
+
32
+ ## Per-repo findings
33
+
34
+ ### pbg-bioreactordesign
35
+
36
+ - **pyproject.toml**: `PASS`
37
+ - **bigraph-schema dep**: `PASS`
38
+ - **process-bigraph dep**: `PASS`
39
+ - **requires-python**: `PASS` — declared: >=3.9
40
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
41
+ - **Process/Step subclasses**: `PASS` — found 1: BiRDReactorProcess (Process)
42
+
43
+ *Summary: PASS: 5, WARN: 1*
44
+
45
+ Recommended fixes:
46
+ - See docs/conventions/distribution.md for trusted-publishing setup
47
+
48
+ ### pbg-caspule
49
+
50
+ - **pyproject.toml**: `PASS`
51
+ - **bigraph-schema dep**: `PASS`
52
+ - **process-bigraph dep**: `PASS`
53
+ - **requires-python**: `PASS` — declared: >=3.9
54
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
55
+ - **Process/Step subclasses**: `PASS` — found 1: CASPULEProcess (Process)
56
+
57
+ *Summary: PASS: 5, WARN: 1*
58
+
59
+ Recommended fixes:
60
+ - See docs/conventions/distribution.md for trusted-publishing setup
61
+
62
+ ### pbg-cellpack
63
+
64
+ - **pyproject.toml**: `PASS`
65
+ - **bigraph-schema dep**: `PASS`
66
+ - **process-bigraph dep**: `PASS`
67
+ - **requires-python**: `PASS` — declared: >=3.9
68
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
69
+ - **Process/Step subclasses**: `PASS` — found 1: CellPackStep (Step)
70
+
71
+ *Summary: PASS: 5, WARN: 1*
72
+
73
+ Recommended fixes:
74
+ - See docs/conventions/distribution.md for trusted-publishing setup
75
+
76
+ ### pbg-comets
77
+
78
+ - **pyproject.toml**: `PASS`
79
+ - **bigraph-schema dep**: `PASS`
80
+ - **process-bigraph dep**: `PASS`
81
+ - **requires-python**: `PASS` — declared: >=3.9
82
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
83
+ - **Process/Step subclasses**: `PASS` — found 3: DynamicFBAProcess (Process), SpatialDynamicFBAProcess (Process), CometsProcess (Process)
84
+
85
+ *Summary: PASS: 5, WARN: 1*
86
+
87
+ Recommended fixes:
88
+ - See docs/conventions/distribution.md for trusted-publishing setup
89
+
90
+ ### pbg-composite-nfsim-caspule
91
+
92
+ - **pyproject.toml**: `PASS`
93
+ - **bigraph-schema dep**: `PASS`
94
+ - **process-bigraph dep**: `PASS`
95
+ - **requires-python**: `PASS` — declared: >=3.10
96
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
97
+ - **Process/Step subclasses**: `PASS` — found 1: ObservableDetector (Step)
98
+
99
+ *Summary: PASS: 5, WARN: 1*
100
+
101
+ Recommended fixes:
102
+ - See docs/conventions/distribution.md for trusted-publishing setup
103
+
104
+ ### pbg-compucell3d
105
+
106
+ - **pyproject.toml**: `PASS`
107
+ - **bigraph-schema dep**: `PASS`
108
+ - **process-bigraph dep**: `PASS`
109
+ - **requires-python**: `PASS` — declared: >=3.9
110
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
111
+ - **Process/Step subclasses**: `PASS` — found 1: CompuCell3DProcess (Process)
112
+
113
+ *Summary: PASS: 5, WARN: 1*
114
+
115
+ Recommended fixes:
116
+ - See docs/conventions/distribution.md for trusted-publishing setup
117
+
118
+ ### pbg-lammps
119
+
120
+ - **pyproject.toml**: `PASS`
121
+ - **bigraph-schema dep**: `PASS`
122
+ - **process-bigraph dep**: `PASS`
123
+ - **requires-python**: `PASS` — declared: >=3.9
124
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
125
+ - **Process/Step subclasses**: `PASS` — found 1: LAMMPSProcess (Process)
126
+
127
+ *Summary: PASS: 5, WARN: 1*
128
+
129
+ Recommended fixes:
130
+ - See docs/conventions/distribution.md for trusted-publishing setup
131
+
132
+ ### pbg-martini
133
+
134
+ - **pyproject.toml**: `PASS`
135
+ - **bigraph-schema dep**: `PASS`
136
+ - **process-bigraph dep**: `PASS`
137
+ - **requires-python**: `PASS` — declared: >=3.9
138
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
139
+ - **Process/Step subclasses**: `PASS` — found 5: MartinizeStep (Step), MembraneBuilderStep (Step), MicelleBuilderStep (Step), ProteinMembraneStep (Step), VesicleBuilderStep (Step)
140
+
141
+ *Summary: PASS: 5, WARN: 1*
142
+
143
+ Recommended fixes:
144
+ - See docs/conventions/distribution.md for trusted-publishing setup
145
+
146
+ ### pbg-medyan
147
+
148
+ - **pyproject.toml**: `PASS`
149
+ - **bigraph-schema dep**: `PASS`
150
+ - **process-bigraph dep**: `PASS`
151
+ - **requires-python**: `PASS` — declared: >=3.9
152
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
153
+ - **Process/Step subclasses**: `PASS` — found 2: MedyanProcess (Process), MedyanCxxProcess (Process)
154
+
155
+ *Summary: PASS: 5, WARN: 1*
156
+
157
+ Recommended fixes:
158
+ - See docs/conventions/distribution.md for trusted-publishing setup
159
+
160
+ ### pbg-mem3dg
161
+
162
+ - **pyproject.toml**: `PASS`
163
+ - **bigraph-schema dep**: `PASS`
164
+ - **process-bigraph dep**: `PASS`
165
+ - **requires-python**: `PASS` — declared: >=3.9
166
+ - **published on PyPI**: `PASS` — published on PyPI as pbg-mem3dg (latest: 0.1.0)
167
+ - **Process/Step subclasses**: `PASS` — found 1: Mem3DGProcess (Process)
168
+
169
+ *Summary: PASS: 6*
170
+
171
+ ### pbg-nfsim
172
+
173
+ - **pyproject.toml**: `PASS`
174
+ - **bigraph-schema dep**: `PASS`
175
+ - **process-bigraph dep**: `PASS`
176
+ - **requires-python**: `PASS` — declared: >=3.9
177
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
178
+ - **Process/Step subclasses**: `PASS` — found 2: NFSimProcess (Process), MonomerProduction (Process)
179
+
180
+ *Summary: PASS: 5, WARN: 1*
181
+
182
+ Recommended fixes:
183
+ - See docs/conventions/distribution.md for trusted-publishing setup
184
+
185
+ ### pbg-readdy
186
+
187
+ - **pyproject.toml**: `PASS`
188
+ - **bigraph-schema dep**: `PASS`
189
+ - **process-bigraph dep**: `PASS`
190
+ - **requires-python**: `PASS` — declared: >=3.9
191
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
192
+ - **Process/Step subclasses**: `PASS` — found 1: ReaDDyProcess (Process)
193
+
194
+ *Summary: PASS: 5, WARN: 1*
195
+
196
+ Recommended fixes:
197
+ - See docs/conventions/distribution.md for trusted-publishing setup
198
+
199
+ ### pbg-smoldyn
200
+
201
+ - **pyproject.toml**: `PASS`
202
+ - **bigraph-schema dep**: `PASS`
203
+ - **process-bigraph dep**: `PASS`
204
+ - **requires-python**: `PASS` — declared: >=3.9
205
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
206
+ - **Process/Step subclasses**: `PASS` — found 1: SmoldynProcess (Process)
207
+
208
+ *Summary: PASS: 5, WARN: 1*
209
+
210
+ Recommended fixes:
211
+ - See docs/conventions/distribution.md for trusted-publishing setup
212
+
213
+ ### pbg-tellurium
214
+
215
+ - **pyproject.toml**: `PASS`
216
+ - **bigraph-schema dep**: `PASS`
217
+ - **process-bigraph dep**: `PASS`
218
+ - **requires-python**: `PASS` — declared: >=3.9
219
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
220
+ - **Process/Step subclasses**: `PASS` — found 2: TelluriumProcess (Process), TelluriumStep (Step)
221
+
222
+ *Summary: PASS: 5, WARN: 1*
223
+
224
+ Recommended fixes:
225
+ - See docs/conventions/distribution.md for trusted-publishing setup
226
+
227
+ ### pbg-vcell-fvsolver
228
+
229
+ - **pyproject.toml**: `PASS`
230
+ - **bigraph-schema dep**: `PASS`
231
+ - **process-bigraph dep**: `PASS`
232
+ - **requires-python**: `PASS` — declared: >=3.11
233
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
234
+ - **Process/Step subclasses**: `PASS` — found 1: VCellFVProcess (Process)
235
+
236
+ *Summary: PASS: 5, WARN: 1*
237
+
238
+ Recommended fixes:
239
+ - See docs/conventions/distribution.md for trusted-publishing setup
240
+
241
+ ### pbg-yalla
242
+
243
+ - **pyproject.toml**: `PASS`
244
+ - **bigraph-schema dep**: `PASS`
245
+ - **process-bigraph dep**: `PASS`
246
+ - **requires-python**: `PASS` — declared: >=3.9
247
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
248
+ - **Process/Step subclasses**: `PASS` — found 1: YallaProcess (Process)
249
+
250
+ *Summary: PASS: 5, WARN: 1*
251
+
252
+ Recommended fixes:
253
+ - See docs/conventions/distribution.md for trusted-publishing setup
254
+
255
+ ### spatio-flux
256
+
257
+ - **pyproject.toml**: `PASS`
258
+ - **bigraph-schema dep**: `PASS`
259
+ - **process-bigraph dep**: `PASS`
260
+ - **requires-python**: `PASS` — declared: >=3.11,<3.13
261
+ - **published on PyPI**: `PASS` — published on PyPI as spatio-flux (latest: 1.3.0)
262
+ - **Process/Step subclasses**: `PASS` — found 13: BigraphicalReactiveSystem (Process), BrownianMovement (Process), ManageBoundaries (Step), ParticleExchange (Step), ParticleDivision (Step)
263
+
264
+ *Summary: PASS: 6*
265
+
266
+ ### v2ecoli
267
+
268
+ - **pyproject.toml**: `PASS`
269
+ - **bigraph-schema dep**: `PASS`
270
+ - **process-bigraph dep**: `PASS`
271
+ - **requires-python**: `PASS` — declared: ==3.12.12
272
+ - **published on PyPI**: `WARN` — NOT published on PyPI — recommend publishing; see docs/conventions/distribution.md
273
+ - **Process/Step subclasses**: `PASS` — found 49: EcoliWCM (Process), Equilibrium (Step), ChromosomeStructure (Step), TwoComponentSystem (Step), TfUnbinding (Step)
274
+
275
+ *Summary: PASS: 5, WARN: 1*
276
+
277
+ Recommended fixes:
278
+ - See docs/conventions/distribution.md for trusted-publishing setup
@@ -0,0 +1,198 @@
1
+ # Composite Spec Convention
2
+
3
+ ## What is a composite spec?
4
+
5
+ A composite spec is a **declarative, data-first** description of a process-bigraph
6
+ `Composite`. It lives in a `*.composite.yaml` or `*.composite.json` file inside an
7
+ installed package. It declares the composite's state document and optional
8
+ configurable parameters.
9
+
10
+ Composites are DATA (state documents), while processes are CODE (subclasses of
11
+ `Edge`/`Process`). Keeping composites as plain files means they can be:
12
+
13
+ - **Inspected** without running Python
14
+ - **Diffed** in git like any structured text
15
+ - **Discovered** by glob without importing any package-specific code
16
+ - **Versioned** independently of the processes they reference
17
+
18
+ ## Format
19
+
20
+ ```yaml
21
+ # REQUIRED:
22
+ name: my-composite # unique within the spec file (used for display and IDs)
23
+ state: # the composite state dict (passed to Composite({'state': ...}))
24
+ process_a:
25
+ _type: process
26
+ address: "local:MyProcess"
27
+ config:
28
+ rate: "${rate}" # parameter substitution (full placeholder — preserves type)
29
+ inputs:
30
+ level: ["stores", "level"]
31
+ outputs:
32
+ level: ["stores", "level"]
33
+ interval: 1.0
34
+ stores:
35
+ level: "${initial_level}"
36
+
37
+ # OPTIONAL:
38
+ description: "Human-readable description of what this composite models."
39
+ requires:
40
+ processes: [MyProcess, RAMEmitter] # must be in core.link_registry at build time
41
+ types: [] # custom type names in core.registry
42
+ parameters:
43
+ rate:
44
+ type: float # one of: float, int, string, str, bool
45
+ default: 1.0
46
+ description: "Multiplicative factor applied each step"
47
+ initial_level:
48
+ type: float
49
+ default: 0.0
50
+ ```
51
+
52
+ ### Required fields
53
+
54
+ | Field | Type | Description |
55
+ |---|---|---|
56
+ | `name` | string | Non-empty identifier for the composite |
57
+ | `state` | dict | The composite state document passed to `Composite({'state': ...})` |
58
+
59
+ ### Optional fields
60
+
61
+ | Field | Type | Description |
62
+ |---|---|---|
63
+ | `description` | string | Human-readable summary |
64
+ | `requires.processes` | list[str] | Process class names that must be in `core.link_registry` |
65
+ | `requires.types` | list[str] | Custom type names that must be in `core.registry` |
66
+ | `parameters` | dict | Named parameters with `type`, `default`, and optional `description` |
67
+
68
+ ## Parameter substitution
69
+
70
+ Any leaf string value in `state` may contain `${name}` placeholders that reference
71
+ declared parameters. There are two substitution modes:
72
+
73
+ ### Full placeholder — type-preserving
74
+
75
+ If the **entire** leaf value is `"${name}"`, the placeholder is replaced with the
76
+ parameter's typed value:
77
+
78
+ ```yaml
79
+ parameters:
80
+ rate:
81
+ type: float
82
+ default: 1.0
83
+ state:
84
+ process_a:
85
+ config:
86
+ rate: "${rate}" # replaced with Python float 1.0, not the string "1.0"
87
+ ```
88
+
89
+ This matters because process-bigraph validates config types. Always use full
90
+ placeholders when referencing numeric or boolean parameters inside `config:`.
91
+
92
+ ### Inline placeholder — string interpolation
93
+
94
+ When `${name}` is embedded within a larger string, the result is always a string:
95
+
96
+ ```yaml
97
+ parameters:
98
+ strain:
99
+ type: string
100
+ default: wt
101
+ state:
102
+ label: "experiment-${strain}-run1" # becomes "experiment-wt-run1"
103
+ ```
104
+
105
+ ### Rules
106
+
107
+ - Parameter names must be valid Python identifiers: `[a-zA-Z_][a-zA-Z0-9_]*`
108
+ - Malformed braces or invalid names are left as-is (no error at parse time)
109
+ - Missing parameters (referenced in state but not declared) raise `KeyError` at
110
+ substitution time
111
+ - Missing defaults with no override raise `KeyError` at substitution time
112
+
113
+ ## Loading and building
114
+
115
+ ```python
116
+ from pathlib import Path
117
+ from pbg_superpowers.composite_spec import load_spec, build_composite_from_spec
118
+
119
+ spec = load_spec(Path("my_package/composites/baseline.composite.yaml"))
120
+
121
+ # Build with defaults
122
+ composite = build_composite_from_spec(spec)
123
+
124
+ # Build with parameter overrides
125
+ composite = build_composite_from_spec(spec, overrides={"rate": 0.5})
126
+
127
+ # Bring your own core (e.g. after registering custom types)
128
+ from process_bigraph import allocate_core
129
+ core = allocate_core()
130
+ composite = build_composite_from_spec(spec, overrides={"rate": 0.5}, core=core)
131
+
132
+ # Run and gather results
133
+ composite.run(10)
134
+ from process_bigraph import gather_emitter_results
135
+ results = gather_emitter_results(composite)
136
+ ```
137
+
138
+ `build_composite_from_spec` will raise `RuntimeError` if any process listed in
139
+ `requires.processes` is absent from the registry, giving a clear error before
140
+ the Composite tries to wire up any ports.
141
+
142
+ ## Discovery
143
+
144
+ `discover_composites` walks all installed distributions that depend on
145
+ `bigraph-schema` and globs for `*.composite.{yaml,yml,json}` under each
146
+ importable package directory:
147
+
148
+ ```python
149
+ from pbg_superpowers.composite_discovery import discover_composites
150
+
151
+ # Discover from all installed packages
152
+ specs = discover_composites()
153
+ # {"pbg_chromosome_rep1.composites.baseline": <spec dict>, ...}
154
+
155
+ # Also search workspace-local directories
156
+ from pathlib import Path
157
+ specs = discover_composites(extra_search_paths=[Path("composites/")])
158
+ ```
159
+
160
+ Spec IDs follow the pattern `<pkg_name>.<subpath>.<file_stem>` — e.g.
161
+ `pbg_chromosome_rep1.composites.baseline` for the file
162
+ `pbg_chromosome_rep1/composites/baseline.composite.yaml`.
163
+
164
+ Discovery **never imports the spec's processes** — it only reads files. This
165
+ keeps it safe to call at startup or in CI without needing every simulator
166
+ installed.
167
+
168
+ ## Why this lives in pbg-superpowers (for now)
169
+
170
+ The convention is intentionally framework-level, but it belongs in
171
+ `pbg-superpowers` until it stabilizes. Once battle-tested across several pbg-*
172
+ packages, the plan is to propose it upstream to `process-bigraph` as an optional
173
+ discovery layer alongside the existing class-based registration.
174
+
175
+ ## When to use a spec file vs a Python function
176
+
177
+ | Situation | Use |
178
+ |---|---|
179
+ | The composite is a canonical scenario users will reuse or share | `*.composite.yaml` spec |
180
+ | The composite structure is generated procedurally | Python function |
181
+ | You want it discoverable across packages without importing | spec file |
182
+ | You need complex logic (conditionals, loops) to wire ports | Python function |
183
+ | You want to diff composite changes in PRs | spec file |
184
+ | The composite is a test helper or one-off | Python function |
185
+
186
+ ## JSON Schema
187
+
188
+ A machine-readable schema for the format lives at:
189
+ `pbg_superpowers/schemas/composite-spec.schema.json`
190
+
191
+ This can be used for editor autocompletion (add it as a YAML/JSON schema
192
+ association in VS Code or PyCharm).
193
+
194
+ ## See also
195
+
196
+ - [Process discovery convention](discovery.md) — how processes (code) are discovered
197
+ - `/pbg-composer` skill — writes in-workspace composite Python files; v0.4.11 will
198
+ also emit `*.composite.yaml` alongside the Python