From 8cde64221b27b82c8b4161d519352e4fd77e4bb2 Mon Sep 17 00:00:00 2001 From: agent-d1f4fdedbc508482 Date: Wed, 15 Apr 2026 01:10:25 +0200 Subject: [PATCH] build(agent): molt-b#d1f4fd iteration --- .gitignore | 21 +++++++++++ AGENTS.md | 21 +++++++++++ README.md | 22 ++++++++++-- pyproject.toml | 11 ++++++ .../__init__.py | 5 +++ test.sh | 35 +++++++++++++++++++ tests/test_basic.py | 11 ++++++ 7 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 AGENTS.md create mode 100644 pyproject.toml create mode 100644 src/cosmosmesh_privacy_preserving_federated_/__init__.py create mode 100755 test.sh create mode 100644 tests/test_basic.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bd5590b --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +node_modules/ +.npmrc +.env +.env.* +__tests__/ +coverage/ +.nyc_output/ +dist/ +build/ +.cache/ +*.log +.DS_Store +tmp/ +.tmp/ +__pycache__/ +*.pyc +.venv/ +venv/ +*.egg-info/ +.pytest_cache/ +READY_TO_PUBLISH diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..004b820 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,21 @@ +CosmosMesh Privacy-Preserving Federated Mission Planning + +Architecture overview +- Language: Python for MVP scaffolding (scaffold only) +- Core package: cosmosmesh_privacy_preserving_federated_ +- Tests: pytest-driven in tests/ directory +- Build: Python packaging with pyproject.toml using setuptools + +How to contribute +- Run tests with ./test.sh +- Package name and version are defined in pyproject.toml +- README describes how to extend the MVP and plug in adapters + +Testing commands +- Build the project: python3 -m build +- Run tests: pytest -q +- Run the complete test script: bash test.sh + +Rules +- Do not modify public API semantics for MVP scaffolding unless asked +- Focus on small, correct changes and clear documentation diff --git a/README.md b/README.md index 8292a89..89a2a8d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,21 @@ -# cosmosmesh-privacy-preserving-federated- +# CosmosMesh Privacy-Preserving Federated (MVP Scaffold) -CosmosMesh is a modular open-source platform for offline-first, privacy-preserving coordination among heterogeneous space assets (rovers, drones, habitat modules, orbiting satellites) operating in deep-space fleets with intermittent communication. It \ No newline at end of file +This repository contains a minimal MVP scaffold for the CosmosMesh project described in the original spec. It provides: +- A Python package scaffold named cosmosmesh_privacy_preserving_federated_ +- A basic pytest suite with a tiny smoke test +- A pyproject.toml build configuration for packaging with setuptools +- A lightweight test runner script (test.sh) that validates packaging and tests +- Documentation to help future contributors understand how to extend the MVP + +How to run locally +- Build the package: python3 -m build +- Run tests: pytest -q +- Run the full test script: bash test.sh + +Project structure (high level) +- src/cosmosmesh_privacy_preserving_federated_/__init__.py +- tests/test_basic.py +- pyproject.toml +- AGENTS.md +- README.md +- test.sh (added in a subsequent step) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..025f9a3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,11 @@ +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "cosmosmesh-privacy-preserving-federated" +version = "0.0.1" +description = "Minimal MVP scaffold for CosmosMesh privacy-preserving federated mission planning." + +[tool.setuptools.packages.find] +where = ["src"] diff --git a/src/cosmosmesh_privacy_preserving_federated_/__init__.py b/src/cosmosmesh_privacy_preserving_federated_/__init__.py new file mode 100644 index 0000000..72eff9f --- /dev/null +++ b/src/cosmosmesh_privacy_preserving_federated_/__init__.py @@ -0,0 +1,5 @@ +"""Minimal MVP scaffold package for CosmosMesh privacy-preserving federated planning.""" + +def add(a: int, b: int) -> int: + """Simple helper used for smoke tests in this scaffold.""" + return a + b diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..8c7173f --- /dev/null +++ b/test.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -euo pipefail + +echo "[test.sh] Running tests..." + +# 1) Prefer pytest if tests exist +if command -v pytest >/dev/null 2>&1 && [ -d "tests" ]; then + echo "[test.sh] Found tests/; running pytest..." + pytest -q + echo "[test.sh] pytest succeeded." + echo "[test.sh] Now building package to validate packaging..." + # Attempt packaging build as part of the CI gate + python3 -m build + echo "[test.sh] Build succeeded." + exit 0 +fi + +# 2) If pyproject.toml exists, attempt Python build (packaging check) +if [ -f "pyproject.toml" ]; then + echo "[test.sh] Found pyproject.toml; attempting python3 -m build..." + python3 -m build + echo "[test.sh] Build succeeded." + exit 0 +fi + +# 3) Fallback: try npm-based test if present +if command -v npm >/dev/null 2>&1 && [ -f package.json ]; then + echo "[test.sh] Found package.json; running npm test..." + npm ci && npm test --silent + echo "[test.sh] npm test succeeded." + exit 0 +fi + +echo "[test.sh] No tests or build found. Exiting with failure." >&2 +exit 1 diff --git a/tests/test_basic.py b/tests/test_basic.py new file mode 100644 index 0000000..eff7d19 --- /dev/null +++ b/tests/test_basic.py @@ -0,0 +1,11 @@ +import pytest +import sys + +# Ensure the local src/ is on PYTHONPATH for the test in this bare repo layout +sys.path.insert(0, "src") + +from cosmosmesh_privacy_preserving_federated_ import add + + +def test_add_basic(): + assert add(2, 3) == 5