Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
cmake_minimum_required(VERSION 3.14)
project(CuraFrame VERSION 3.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# All constraint-bundle translation units
set(BUNDLE_SOURCES
constraints/anti_infective/AntiInfectiveBundle.cpp
constraints/cardiac/CardiacBundle.cpp
constraints/cns/CNSBundle.cpp
Comment on lines +8 to +12
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

PR description says the build compiles "11 bundle TUs", but BUNDLE_SOURCES here lists 12 bundles (including systemic_exposure). Please update the PR description or the source list so they match.

Copilot uses AI. Check for mistakes.
constraints/formulation/FormulationBundle.cpp
constraints/hepatic/HepaticBundle.cpp
constraints/immunologic/ImmunologicBundle.cpp
constraints/metabolic/MetabolicBundle.cpp
constraints/oncology/OncologyBundle.cpp
constraints/pkpd/PKPDBundle.cpp
constraints/renal/RenalBundle.cpp
constraints/safety/SafetyBundle.cpp
constraints/systemic_exposure/SystemicExposureBundle.cpp
)

# Scoring subsystem translation units
set(SCORING_SOURCES
scoring/WeightProfile.cpp
scoring/WeightedScoringEngine.cpp
scoring/ScoringPipeline.cpp
)

# Static library bundling all C++ constraint and scoring logic.
# The repository root is exposed as the include root so that all relative
# includes (e.g. "constraint_core/Candidate.hpp" or "../scoring/...") resolve
# correctly regardless of which translation unit is being compiled.
add_library(curaframe_cpp STATIC
${BUNDLE_SOURCES}
${SCORING_SOURCES}
)

target_include_directories(curaframe_cpp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

target_compile_options(curaframe_cpp PRIVATE
$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang>:-Wall -Wextra -Wpedantic>
$<$<CXX_COMPILER_ID:MSVC>:/W4>
)

# NOTE: Each bundle uses the REGISTER_CONSTRAINT_BUNDLE self-registration macro,
# which installs a static initialiser in its own translation unit. When linking
# this library into an executable, force the linker to include every object file
# so that all initialisers run, even those with no externally referenced symbols:
#
# GCC / Clang (Linux):
# target_link_libraries(my_app PRIVATE
# -Wl,--whole-archive curaframe_cpp -Wl,--no-whole-archive)
#
# Clang (macOS):
# target_link_libraries(my_app PRIVATE
# -Wl,-force_load,$<TARGET_FILE:curaframe_cpp>)
#
# MSVC:
# target_link_libraries(my_app PRIVATE /WHOLEARCHIVE:curaframe_cpp)
3 changes: 2 additions & 1 deletion constraint_core/MultiBundleEvaluator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
#include "EvaluationReport.hpp"
#include "ConstraintRegistry.hpp"
#include "../scoring/ScoringPipeline.hpp"
#include "../scoring/ScoringReport.hpp"
#include "../scoring/WeightProfile.hpp"
#include <sstream>

// Unified Evaluation Layer
class MultiBundleEvaluator {
public:
EvaluationReport evaluate(const Candidate& candidate) {
EvaluationReport evaluate(const Candidate& candidate) const {
EvaluationReport report;
report.candidate_id = candidate.id;

Expand Down
3 changes: 3 additions & 0 deletions constraints/anti_infective/AntiInfectiveBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "AntiInfectiveBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("AntiInfective", AntiInfectiveBundle)
3 changes: 0 additions & 3 deletions constraints/anti_infective/AntiInfectiveBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_ANTI_INFECTIVE_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class AntiInfectiveBundle : public ConstraintBundle {
Expand Down Expand Up @@ -58,6 +57,4 @@ class AntiInfectiveBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("AntiInfective", AntiInfectiveBundle)

#endif // CURAFRAME_ANTI_INFECTIVE_BUNDLE_HPP
3 changes: 3 additions & 0 deletions constraints/cardiac/CardiacBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "CardiacBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("Cardiac", CardiacBundle)
3 changes: 0 additions & 3 deletions constraints/cardiac/CardiacBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_CARDIAC_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class CardiacBundle : public ConstraintBundle {
Expand Down Expand Up @@ -59,6 +58,4 @@ class CardiacBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("Cardiac", CardiacBundle)

#endif // CURAFRAME_CARDIAC_BUNDLE_HPP
3 changes: 3 additions & 0 deletions constraints/cns/CNSBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "CNSBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("CNS", CNSBundle)
3 changes: 0 additions & 3 deletions constraints/cns/CNSBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_CNS_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class CNSBundle : public ConstraintBundle {
Expand Down Expand Up @@ -59,6 +58,4 @@ class CNSBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("CNS", CNSBundle)

#endif // CURAFRAME_CNS_BUNDLE_HPP
3 changes: 3 additions & 0 deletions constraints/formulation/FormulationBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "FormulationBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("Formulation", FormulationBundle)
3 changes: 0 additions & 3 deletions constraints/formulation/FormulationBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_FORMULATION_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class FormulationBundle : public ConstraintBundle {
Expand Down Expand Up @@ -57,6 +56,4 @@ class FormulationBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("Formulation", FormulationBundle)

#endif // CURAFRAME_FORMULATION_BUNDLE_HPP
3 changes: 3 additions & 0 deletions constraints/hepatic/HepaticBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "HepaticBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("Hepatic", HepaticBundle)
3 changes: 0 additions & 3 deletions constraints/hepatic/HepaticBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_HEPATIC_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class HepaticBundle : public ConstraintBundle {
Expand Down Expand Up @@ -59,6 +58,4 @@ class HepaticBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("Hepatic", HepaticBundle)

#endif // CURAFRAME_HEPATIC_BUNDLE_HPP
3 changes: 3 additions & 0 deletions constraints/immunologic/ImmunologicBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "ImmunologicBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("Immunologic", ImmunologicBundle)
3 changes: 0 additions & 3 deletions constraints/immunologic/ImmunologicBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_IMMUNOLOGIC_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class ImmunologicBundle : public ConstraintBundle {
Expand Down Expand Up @@ -60,6 +59,4 @@ class ImmunologicBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("Immunologic", ImmunologicBundle)

#endif // CURAFRAME_IMMUNOLOGIC_BUNDLE_HPP
3 changes: 3 additions & 0 deletions constraints/metabolic/MetabolicBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "MetabolicBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("Metabolic", MetabolicBundle)
3 changes: 0 additions & 3 deletions constraints/metabolic/MetabolicBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_METABOLIC_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class MetabolicBundle : public ConstraintBundle {
Expand Down Expand Up @@ -75,6 +74,4 @@ class MetabolicBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("Metabolic", MetabolicBundle)

#endif // CURAFRAME_METABOLIC_BUNDLE_HPP
3 changes: 3 additions & 0 deletions constraints/oncology/OncologyBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "OncologyBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("Oncology", OncologyBundle)
3 changes: 0 additions & 3 deletions constraints/oncology/OncologyBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_ONCOLOGY_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class OncologyBundle : public ConstraintBundle {
Expand Down Expand Up @@ -59,6 +58,4 @@ class OncologyBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("Oncology", OncologyBundle)

#endif // CURAFRAME_ONCOLOGY_BUNDLE_HPP
3 changes: 3 additions & 0 deletions constraints/pkpd/PKPDBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "PKPDBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("PKPD", PKPDBundle)
3 changes: 0 additions & 3 deletions constraints/pkpd/PKPDBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_PKPD_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class PKPDBundle : public ConstraintBundle {
Expand Down Expand Up @@ -58,6 +57,4 @@ class PKPDBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("PKPD", PKPDBundle)

#endif // CURAFRAME_PKPD_BUNDLE_HPP
3 changes: 3 additions & 0 deletions constraints/renal/RenalBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "RenalBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("Renal", RenalBundle)
3 changes: 0 additions & 3 deletions constraints/renal/RenalBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_RENAL_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class RenalBundle : public ConstraintBundle {
Expand Down Expand Up @@ -59,6 +58,4 @@ class RenalBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("Renal", RenalBundle)

#endif // CURAFRAME_RENAL_BUNDLE_HPP
3 changes: 3 additions & 0 deletions constraints/safety/SafetyBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "SafetyBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("Safety", SafetyBundle)
3 changes: 0 additions & 3 deletions constraints/safety/SafetyBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_SAFETY_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class SafetyBundle : public ConstraintBundle {
Expand Down Expand Up @@ -56,6 +55,4 @@ class SafetyBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("Safety", SafetyBundle)

#endif // CURAFRAME_SAFETY_BUNDLE_HPP
3 changes: 3 additions & 0 deletions constraints/systemic_exposure/SystemicExposureBundle.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "SystemicExposureBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"

REGISTER_CONSTRAINT_BUNDLE("SystemicExposure", SystemicExposureBundle)
3 changes: 0 additions & 3 deletions constraints/systemic_exposure/SystemicExposureBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CURAFRAME_SYSTEMIC_EXPOSURE_BUNDLE_HPP

#include "../../constraint_core/ConstraintBundle.hpp"
#include "../../constraint_core/ConstraintRegistry.hpp"
#include <sstream>

class SystemicExposureBundle : public ConstraintBundle {
Expand Down Expand Up @@ -64,6 +63,4 @@ class SystemicExposureBundle : public ConstraintBundle {
std::string narrative_summary() const override { return summary; }
};

REGISTER_CONSTRAINT_BUNDLE("SystemicExposure", SystemicExposureBundle)

#endif // CURAFRAME_SYSTEMIC_EXPOSURE_BUNDLE_HPP
4 changes: 2 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to the C++ parallel evaluation universe will be documented in this file.

## [3.0.0] - Weighted Scoring Engine
## [3.0.0] - 2026-04-10 - Weighted Scoring Engine

### Added
- **Weighted Multi-Constraint Scoring Engine**: Introduced a unified scoring engine that computes a Composite Stability Score (0-100) from constraint bundle outputs.
Expand All @@ -14,7 +14,7 @@ All notable changes to the C++ parallel evaluation universe will be documented i
### Changed
- Bumped project version to 3.0.0.

## [2.5.0] - Constraint-Bundle Universe
## [2.5.0] - 2026-04-10 - Constraint-Bundle Universe

### Added
- **C++ Core Architecture:** Introduced `Candidate.hpp`, `EvaluationReport.hpp`, `ConstraintBundle.hpp`, `ConstraintRegistry.hpp`, and `MultiBundleEvaluator.hpp` in the `constraint_core/` directory to serve as the unified parallel evaluation layer.
Expand Down
2 changes: 1 addition & 1 deletion docs/constraint_bundles.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ CuraFrame features a parallel C++ constraint-bundle universe evaluating therapeu
### Physicochemical & Pharmacological
- **Formulation (`FormulationBundle`):** Solubility deficits, chemical instability, delivery-vector incompatibilities.
- **PK/PD (`PKPDBundle`):** Dose-response slope analysis, receptor saturation, effect-window decoupling flags.
- **Global Safety (`SafetyBundle`):** Multi-organ stress aggregation, systemic catastrophe triggers.
- **Safety (`SafetyBundle`):** Multi-organ stress aggregation, systemic catastrophe triggers.
6 changes: 3 additions & 3 deletions docs/evaluation_pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ int main() {
EvaluationReport report = evaluator.evaluate(c);

if (!report.is_viable()) {
std::cout << "Candidate Falsified. Triggers:\\n";
std::cout << "Candidate Falsified. Triggers:\n";
for (const auto& flag : report.falsification_flags) {
std::cout << "- " << flag << "\\n";
std::cout << "- " << flag << "\n";
}
}

std::cout << "\\nNarrative Summary:\\n" << report.combined_narrative << "\\n";
std::cout << "\nNarrative Summary:\n" << report.combined_narrative << "\n";
return 0;
}
```
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "CuraFrame"
version = "3.0.0"
description = "Constraint-driven therapeutic design reasoning framework."
requires-python = ">=3.9"
Comment on lines +5 to +9
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

[project] metadata is now duplicated between pyproject.toml and setup.py (name/version/description/python_requires). This creates two sources of truth and can cause drift or ambiguous packaging behavior with setuptools. Consider moving all core metadata to pyproject.toml and reducing setup.py to a minimal shim (or removing the duplicated fields) so only one file owns the version and project metadata.

Copilot uses AI. Check for mistakes.
3 changes: 2 additions & 1 deletion scoring/ScoringReport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ struct ScoringReport {
// Per-bundle weighted contributions
std::map<std::string, double> bundle_contributions;

// Breakdowns
// Breakdowns — keys are formatted as "domain_name::signal_name"
// (e.g. "Cardiac::qt_prolongation_risk").
std::map<std::string, double> penalty_breakdown;
std::map<std::string, double> bonus_breakdown;

Expand Down
8 changes: 6 additions & 2 deletions scoring/WeightProfile.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#include "WeightProfile.hpp"

// Intentionally left blank or simple implementations if needed.
// Weight profiles are currently fully implemented inline in the header for simplicity and polymorphism.
// All WeightProfile methods are implemented inline in WeightProfile.hpp because
// the class relies entirely on virtual dispatch with small, default-valued
// implementations that benefit from inlining. This translation unit exists to
// compile the header as part of the curaframe_cpp static library, ensuring that
// the vtable and RTTI for WeightProfile, DefaultResearchProfile, and
// HighSafetyProfile are emitted exactly once.
Comment on lines +3 to +8
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This comment claims compiling this TU ensures the vtable/RTTI for these polymorphic types are emitted exactly once, but with all virtual functions (including the destructor) defined inline there is no key function, so vtable emission is not guaranteed to be centralized in this TU. Either adjust the comment to reflect that this file primarily exists to force compilation of the header in the library, or introduce an out-of-line key function (e.g., a non-inline virtual destructor definition) if you truly need single-TU vtable emission.

Copilot uses AI. Check for mistakes.
Loading
Loading