Skip to content

Reorganizing models and enabling "other" models#12

Open
akutuva21 wants to merge 30 commits intoRuleWorld:masterfrom
akutuva21:master
Open

Reorganizing models and enabling "other" models#12
akutuva21 wants to merge 30 commits intoRuleWorld:masterfrom
akutuva21:master

Conversation

@akutuva21
Copy link
Copy Markdown
Member

This PR refactors the RuleHub directory structure and updates metadata categories according to the latest requirements.

Key Changes

  1. Restructured Top-Level Directories: Simplified the repository to mainly three directories: Published, Examples, and Tutorials.
  2. Reorganized Models:
    • Moved AI-generated playground examples to the new Examples directory.
    • Moved previously grouped PyBioNetGen published models to Published/PyBioNetGen.
    • Moved all published models adhering to the AuthorYear format from Contributed/ to Published/.
    • Re-distributed BNGPlayground_Validation models based on their origin (published vs. tutorials).
  3. Updated Metadata and Categories:
    • Addressed models grouped ambiguously under "category: other".
    • Introduced descriptive categories (mechanistic-modeling, feature-demos, compartments, wacky, energy, etc.) to the metadata-schema.yaml.
    • Updated corresponding metadata.yaml files.
  4. Updated Scripts:
    • generate-manifest.js and validate-metadata.js modified to scan the new root directories.
  5. Validation and Generation: Re-ran the manifest generation to reflect the correct paths and categories.

google-labs-jules bot and others added 30 commits March 31, 2026 21:05
- Create \`Examples\`, \`Published\`, and \`Tutorials\` root directories.
- Move \`Contributed/BNGPlayground_Examples\` to \`Examples\`.
- Move published model subdirectories (e.g., PyBioNetGen models, Contributed/Hlavacek2018, Contributed/Mitra2019, Validation models like Korwek2023, MyrtleBeach) to \`Published\`.
- Move remaining items in \`Contributed/BNGPlayground_Validation\` and \`BNGPlayground_PublicRuntime\` to \`Tutorials\`.
- Update \`metadata-schema.yaml\` to add explicit domains (\`compartments\`, \`energy\`, \`wacky\`, \`mechanistic-modeling\`, etc.).
- Update \`metadata.yaml\` files previously labeled as \`other\` with the new, specific categories.
- Update \`scripts/generate-manifest.js\` and \`scripts/validate-metadata.js\` with new \`SEARCH_ROOTS\` and categories.
- Regenerate \`manifest.json\`.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
…969453

chore: Restructure RuleHub directories and improve metadata categories
Fixes a prototype pollution vulnerability in the `setNested` utility function within `scripts/generate-manifest.js`. The fix explicitly skips and filters out dangerous property names (`__proto__`, `constructor`, `prototype`) during both object traversal and final assignment.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
* Refactor `scripts/validate-metadata.js` to export `parseScalar` and conditionally execute `main()`.
* Add `scripts/tests/validate-metadata.test.js` covering all behavior.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
Removed the `# FIX: Add Autoinducer dynamics` comment from `Examples/biology/quorumsensingcircuit/quorum-sensing-circuit.bngl` as the implementation for production and degradation is already present below it.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
Removed the '# FIX: Add resource dynamics' comment as the resource regeneration and decay rules are already implemented correctly in the model.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
Updated `setNested` to accept an array of parts instead of a dotted path string, avoiding redundant string splitting.

Tested with a 100,000 iteration benchmark on `parseMetadataYaml`, measuring ~20% improvement (from ~1.25s to ~0.98s).

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
- Refactor `scripts/validate-metadata.js` to only run `main()` if executed directly.
- Export `validateMetadataFile` to allow testing it in isolation.
- Add comprehensive test suite in `tests/validate-metadata.test.js` covering valid files, missing files, and invalid configuration scenarios using temporary directory fixtures.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
Refactored generate-manifest.js to allow importing internal functions and added comprehensive unit tests for buildEntry using node:test.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
Updated `ds3()` in `sp_fourier_synthesizer.bngl` to use the exact derivative of the 3rd harmonic trigonometric identity instead of an approximation. Cleaned up corresponding comments.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
Extracted the duplicated listModelFiles function from scripts/generate-manifest.js and scripts/validate-metadata.js into a shared utility module (scripts/utils.js). This improves code maintainability and adheres to DRY principles.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
…-9077399113245613909

Fix: Remove Autoinducer dynamics FIX comment
…2033588725295054439

Remove resolved FIX comment in eco_food_web_chaos_3sp.bngl
…438250706711219829

🧪 Add generate-manifest.js testing coverage
…3267491605790

⚡ perf(manifest): optimize setNested path handling
…-16219869687540900783

🧪 [testing] add tests for parseScalar in validate-metadata.js
…6954674524457256

🧪 testing: add tests for validateMetadataFile
…451205665425511

🧹 Refactor: Extract listModelFiles function into a shared utility module
…67357569153273

Implement 3rd harmonic using trigonometric identity
…411393383498

🧪 test: add unit tests for custom parseMetadataYaml function
…-15072088604429859966

🔒 Fix Prototype Pollution in setNested
@akutuva21
Copy link
Copy Markdown
Member Author

Added other security fixes and small edits suggested by Jules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant