Skip to content

feat(cli): auto-generate STUDY.json metadata for init and run outputs#504

Open
GaneshPatil7517 wants to merge 3 commits intoControlCore-Project:devfrom
GaneshPatil7517:feature/study-json-metadata-devbase
Open

feat(cli): auto-generate STUDY.json metadata for init and run outputs#504
GaneshPatil7517 wants to merge 3 commits intoControlCore-Project:devfrom
GaneshPatil7517:feature/study-json-metadata-devbase

Conversation

@GaneshPatil7517
Copy link

@GaneshPatil7517 GaneshPatil7517 commented Mar 15, 2026

This PR adds automatic STUDY.json generation for studies created via concore init and workflow outputs generated via concore run.
The goal is to improve study traceability with lightweight, machine-readable metadata.

What Changed

  1. Added a metadata writer that creates STUDY.json with:
  • generated_by
  • concore_version
  • timestamp
  • python_version
  • platform
  • study_name
  • working_directory
  • tools_detected
  • checksums
  • schema_version

2.Integrated metadata generation into:

  • concore init
  • concore run

3.Extended CLI tests to verify:

  • STUDY.json is created
  • expected keys and values are present for init and run flows
  1. Updated openJupyter security tests to run reliably in test mode by setting required test environment variables, including FLASK_SECRET_KEY.

Why

  • Improves reproducibility metadata for generated studies.
  • Provides clear provenance for how and where artifacts were generated.
  • Keeps the change additive and non-breaking.

Validation
Local test results:

  • 160 passed
  • 0 skipped
  • 0 failed

Compatibility

  • No breaking changes to existing commands or workflows.
  • Metadata file is additive and optional for downstream usage.

Fixes #502

Copilot AI review requested due to automatic review settings March 15, 2026 14:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds automatic generation of a STUDY.json metadata file to improve traceability for studies created via concore init and workflow outputs generated via concore run.

Changes:

  • Added a write_study_metadata(...) helper to generate STUDY.json with provenance, tool detection, and checksums.
  • Integrated metadata generation into concore init and concore run flows.
  • Extended CLI and openJupyter security tests to validate metadata creation and ensure required env vars (e.g., FLASK_SECRET_KEY) are set in test mode.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
concore_cli/commands/metadata.py Introduces the STUDY.json writer (checksums/tool detection/provenance fields).
concore_cli/commands/init.py Calls metadata writer during project initialization and prints metadata info.
concore_cli/commands/run.py Calls metadata writer after workflow generation and prints metadata path.
tests/test_cli.py Adds assertions that STUDY.json is created with expected fields for init/run.
tests/test_openjupyter_security.py Patches required env vars (incl. FLASK_SECRET_KEY) to make security tests reliable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GaneshPatil7517
Copy link
Author

hello @pradeeban the pr is ready to review please review it when you are free....

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.

2 participants