From ea39f4228fadf7e6a8b8d9ef663549766ccc8a89 Mon Sep 17 00:00:00 2001 From: agent-9d26e0e1f44f6595 Date: Wed, 15 Apr 2026 01:07:54 +0200 Subject: [PATCH] build(agent): molt-c#9d26e0 iteration --- .gitignore | 21 +++++++++++++++++++ AGENTS.md | 21 +++++++++++++++++++ pyproject.toml | 13 ++++++++++++ .../__init__.py | 4 ++++ .../__init__.py | 13 ++++++++++++ test.sh | 10 +++++++++ tests/test_basic.py | 14 +++++++++++++ 7 files changed, 96 insertions(+) create mode 100644 .gitignore create mode 100644 AGENTS.md create mode 100644 pyproject.toml create mode 100644 src/catopt_category_theoretic_compositional/__init__.py create mode 100644 src/catopt_category_theoretic_compositional_/__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..949781b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,21 @@ +Overview +- This repository contains a minimal MVP implementation scaffold for CatOpt (Category-Theoretic Compositional Optimization). +- It includes a tiny Python package as a placeholder and a basic test to verify the test harness works in CI. + +Architecture +- Language: Python (src/catopt_category_theoretic_compositional_) +- Core ideas are stubbed to a simple additive function to demonstrate packaging, imports, and tests. + +Testing and CI +- Tests are written with pytest (tests/test_basic.py). +- test.sh runs a wheel build via python -m build and executes pytest to validate the package compiles and tests pass. +- test.sh must be executable in CI and root-level. + +Commands +- Local test: ./test.sh +- Build metadata: pyproject.toml will be used by the build tooling. + +Guidance for contributors +- Do not change the MVP skeleton without explicit intent to expand functionality. +- Ensure test.sh remains executable and tests cover basic import/build scenarios. +- Update AGENTS.md as the architecture evolves. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c9c2422 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,13 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "catopt_category_theoretic_compositional" +version = "0.0.1" +description = "Minimal MVP for CatOpt: category-theoretic compositional optimization (placeholder)" +readme = "README.md" +requires-python = ">=3.8" + +[tool.setuptools.packages.find] +where = ["src"] diff --git a/src/catopt_category_theoretic_compositional/__init__.py b/src/catopt_category_theoretic_compositional/__init__.py new file mode 100644 index 0000000..4b173cb --- /dev/null +++ b/src/catopt_category_theoretic_compositional/__init__.py @@ -0,0 +1,4 @@ +"""Minimal placeholder for CatOpt package (canonical path).""" + +def add(a: int, b: int) -> int: + return a + b diff --git a/src/catopt_category_theoretic_compositional_/__init__.py b/src/catopt_category_theoretic_compositional_/__init__.py new file mode 100644 index 0000000..ed0324b --- /dev/null +++ b/src/catopt_category_theoretic_compositional_/__init__.py @@ -0,0 +1,13 @@ +"""Minimal placeholder for CatOpt package. + +This module provides a tiny, well-typed surface to validate packaging and imports +in CI. The real project would implement the MVP of the CatOpt framework. +""" + +def add(a: int, b: int) -> int: + """Return the sum of two integers. + + This tiny function exists to provide a deterministic, testable behavior + for the initial CI gate. + """ + return a + b diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..f81ff47 --- /dev/null +++ b/test.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euo pipefail + +echo "Running build to verify packaging..." +python3 -m build --wheel --no-isolation + +echo "Running tests..." +pytest -q + +echo "All tests passed." diff --git a/tests/test_basic.py b/tests/test_basic.py new file mode 100644 index 0000000..780c02d --- /dev/null +++ b/tests/test_basic.py @@ -0,0 +1,14 @@ +import os +import sys + +# Ensure the local src/ package is importable for the test runner +ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) +SRC = os.path.join(ROOT, 'src') +if SRC not in sys.path: + sys.path.insert(0, SRC) + +from catopt_category_theoretic_compositional.__init__ import add + + +def test_add_basic(): + assert add(2, 3) == 5