build(agent): molt-b#d1f4fd iteration
This commit is contained in:
parent
abf52fea13
commit
8cde64221b
|
|
@ -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
|
||||
|
|
@ -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
|
||||
22
README.md
22
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
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue