Skip to content

[limen RESOLVE-organvm-i-theoria-rules-system-bound-8] resolve rules-system-bound#8 (UNSTABLE) - #10

Merged
4444J99 merged 1 commit into
mainfrom
limen/resolve-organvm-i-theoria-rules-system-bound-8-6f48
Jul 6, 2026
Merged

4444J99 merged 1 commit into
mainfrom
limen/resolve-organvm-i-theoria-rules-system-bound-8-6f48

Conversation

@4444J99

@4444J99 4444J99 commented Jun 19, 2026 •

Copy link
Copy Markdown
Owner

Autonomous limen dispatch of task RESOLVE-organvm-i-theoria-rules-system-bound-8.

Resolve blocked PR #8 ('[limen GH-organvm-i-theoria-rules-system-bound-2] ACTIVATION'), state=UNSTABLE. Branch=limen/gh-organvm-i-theoria-rules-system-bound-2-26b9, base=main. In the worktree: git fetch origin limen/gh-organvm-i-theoria-rules-system-bound-2-26b9 main; git checkout -B limen/gh-organvm-i-theoria-rules-system-bound-2-26b9 origin/limen/gh-organvm-i-theoria-rules-system-bound-2-26b9; git rebase origin/main then address the failing checks / unresolved review threads; run the build/tests; git push --force-with-lease origin limen/gh-organvm-i-theoria-rules-system-bound-2-26b9. If the branch is unrecoverable, instead REBUILD the same feature cleanly off origin/main as a fresh PR. Goal: make it mergeable.

Produced in an isolated worktree off origin — review before merge.

Summary by Sourcery

Introduce a documented activation CLI and smoke path for the rules-system-bound package, and tighten configuration/env handling to support deterministic runnable evidence.

New Features:

  • Add a console script and CLI module that generate a deterministic activation report in JSON or human-readable text.
  • Expose a module entry point so the package can be executed via python -m rules_system_bound.
  • Provide a documented activation audit describing install and execution commands for runnable evidence.

Bug Fixes:

  • Ensure configuration values loaded from environment variables are coerced to the appropriate field types instead of remaining strings.
  • Make the exported package version dynamically reflect the installed distribution when available.

Enhancements:

  • Document the console script and activation smoke path in the README, including from-source and post-install usage.
  • Configure pytest to resolve the src layout via pythonpath and ensure the package exposes __version__ in its public API.

CI:

  • Add a GitHub Actions Python CI workflow that installs the package, runs tests, and executes the activation smoke path across multiple Python versions.

@sourcery-ai

sourcery-ai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Adds a documented activation smoke path and CLI for the rules-system-bound package, introduces type-safe environment config coercion, wires up packaging/entry points and CI, and documents runnable evidence for the library.

Sequence diagram for the activation smoke path CLI execution

sequenceDiagram
    actor Developer
    participant Shell
    participant CLI_main as main
    participant Parser as build_parser
    participant Reporter as activation_report
    participant Config as get_config
    participant Stdout

    Developer->>Shell: rules-system-bound --json
    Shell->>CLI_main: invoke main(argv)
    CLI_main->>Parser: build_parser()
    Parser-->>CLI_main: ArgumentParser
    CLI_main->>CLI_main: parser.parse_args(argv)
    CLI_main->>Reporter: activation_report()
    Reporter->>Config: get_config()
    Config-->>Reporter: Config
    Reporter-->>CLI_main: report
    CLI_main->>Stdout: print(json.dumps(report, ...))
    Stdout-->>Developer: JSON activation evidence
Loading

File-Level Changes

Change Details Files
Ensure environment-derived configuration values are coerced to the correct field types.
  • Introduce a helper to coerce environment string values to bool/float/int based on the default config value type.
  • Update Config.from_env to use the coercion helper and fall back to defaults when env vars are unset.
  • Add tests verifying that environment configuration preserves numeric and boolean field types.
src/rules_system_bound/config.py
tests/test_core.py
Introduce a CLI activation smoke path that exercises the core public API and supports JSON and human-readable output.
  • Add a cli module that builds a deterministic activation report using Container, ContainmentRules, System, InteractionEmergence, IdealizationManager, and configuration.
  • Implement text rendering for the activation report and a main entry point that supports --json and --version flags.
  • Expose the CLI both as a console script and as a python -m rules_system_bound module entry point, and add tests for CLI behavior and text rendering.
src/rules_system_bound/cli.py
src/rules_system_bound/__main__.py
pyproject.toml
tests/test_core.py
Improve package metadata, version handling, and activation documentation, including CI wiring and activation audit evidence.
  • Make version resolve dynamically via importlib.metadata, with a default fallback for editable installs.
  • Add a project console script entry point and configure pytest to discover tests with src on PYTHONPATH.
  • Extend README with explicit install commands, CLI usage, and runnable evidence sections, plus update CONTRIBUTING-style setup instructions.
  • Add an activation audit document capturing install, test, and smoke-path commands and expected behavior.
  • Introduce a GitHub Actions CI workflow that runs tests and the activation smoke path across multiple Python versions.
src/rules_system_bound/__init__.py
pyproject.toml
README.md
docs/activation-audit.md
.github/workflows/ci-python.yml

Possibly linked issues

  • ACTIVATION AUDIT: ship-soon #2: The PR adds CLI, docs, tests, and CI that provide the activation evidence and workflows specified in the audit issue.
  • ACTIVATION AUDIT: ship-soon #2: PR fully implements the activation audit: CLI smoke path, documented exec commands, activation-audit receipt, and CI checks.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@4444J99, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 59 minutes and 1 second. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 89ffa016-9836-4d37-9145-cc28d00200bb

📥 Commits

Reviewing files that changed from the base of the PR and between bf80987 and d688863.

📒 Files selected for processing (10)
  • .github/workflows/ci-python.yml
  • .gitignore
  • README.md
  • docs/activation-audit.md
  • pyproject.toml
  • src/rules_system_bound/__init__.py
  • src/rules_system_bound/__main__.py
  • src/rules_system_bound/cli.py
  • src/rules_system_bound/config.py
  • tests/test_core.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch limen/resolve-organvm-i-theoria-rules-system-bound-8-6f48

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new _coerce_env_value used by Config.from_env will now raise ValueError on unexpected boolean strings (and invalid ints/floats), which can make misconfigured environments crash at import/initialization time; consider either catching and wrapping this with a clearer configuration error or falling back to the default with a warning.
  • The CLI activation_report currently hardcodes specific container/interaction/idealization instances; if you expect this to evolve, you might want to factor the fixture-building logic into a helper so future behavioral changes are localized and the report format remains stable for consumers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `_coerce_env_value` used by `Config.from_env` will now raise `ValueError` on unexpected boolean strings (and invalid ints/floats), which can make misconfigured environments crash at import/initialization time; consider either catching and wrapping this with a clearer configuration error or falling back to the default with a warning.
- The CLI `activation_report` currently hardcodes specific container/interaction/idealization instances; if you expect this to evolve, you might want to factor the fixture-building logic into a helper so future behavioral changes are localized and the report format remains stable for consumers.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request establishes a command-line interface (CLI) and an activation smoke path for the Living Container Framework, adding a module entry point, console script configuration, and comprehensive activation audit documentation. Additionally, it implements environment variable type coercion for configuration loading along with supporting unit tests. The feedback recommends enhancing error handling during environment variable coercion by wrapping the coercion logic in a try-except block to raise a more descriptive ValueError that identifies the problematic environment variable.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/rules_system_bound/config.py Outdated
Comment on lines 73 to 78
config = {}
for key, default in DEFAULT_CONFIG.items():
env_key = f"{key.upper()}"
config[key] = os.getenv(env_key, default)
value = os.getenv(env_key)
config[key] = default if value is None else _coerce_env_value(value, default)
return cls(**config)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

When loading configuration from environment variables, any ValueError raised during type coercion (e.g., if a float or boolean variable is misconfigured in the environment) will propagate with a generic error message. Wrapping the coercion in a try-except block and raising a more descriptive ValueError that includes the specific environment variable name (env_key) would significantly improve debuggability and maintainability.

Suggested change
config = {}
for key, default in DEFAULT_CONFIG.items():
env_key = f"{key.upper()}"
config[key] = os.getenv(env_key, default)
value = os.getenv(env_key)
config[key] = default if value is None else _coerce_env_value(value, default)
return cls(**config)
config = {}
for key, default in DEFAULT_CONFIG.items():
env_key = f"{key.upper()}"
value = os.getenv(env_key)
if value is not None:
try:
config[key] = _coerce_env_value(value, default)
except ValueError as e:
raise ValueError(f"Invalid value for environment variable {env_key}: {e}") from e
else:
config[key] = default
return cls(**config)

@llamapreview llamapreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI Code Review by LlamaPReview

🎯 TL;DR & Recommendation

Recommendation: Request Changes

This PR adds a documented CLI activation smoke path and env type coercion, but CI tests are failing on multiple Python versions, blocking merge.

📄 Documentation Diagram

This diagram documents the new CLI activation smoke path that exercises the core public API.

sequenceDiagram
    participant Developer
    participant CLI as cli.main
    participant Container as Container/ContainmentRules
    participant System as System
    participant Interaction as InteractionEmergence
    participant Idealization as IdealizationManager
    participant Config as Config

    Developer->>CLI: main(["--json"])
    CLI->>CLI: build_parser()
    CLI->>CLI: activation_report()
    CLI->>Container: create root, bounded containers<br/>and compute containment
    CLI->>System: create processor, store systems
    CLI->>Interaction: register systems and discover interactions
    CLI->>Idealization: create WEBERIAN form and relate to root
    CLI->>Config: get_config() (reads env)
    note over CLI: PR #35;10 adds CLI smoke path
    CLI-->>CLI: report dict
    CLI->>CLI: json.dumps()
    CLI-->>Developer: JSON activation evidence
Loading

🌟 Strengths

  • Solid documentation of activation smoke path and runnable evidence in README and activation-audit.md.
  • Adds CI pipeline and test coverage for the new features.
Priority File Category Impact Summary (≤12 words) Anchors
P0 .github/workflows/ci-python.yml Testing CI tests failing on multiple Python versions path:tests/test_core.py
P2 src/rules_system_bound/config.py Bug Strict env coercion may crash on legacy vars symbol:Config.from_env
P2 tests/test_core.py Maintainability Test isolation could cause flaky failures
P2 src/rules_system_bound/cli.py Architecture CLI report non-deterministic due to env config symbol:get_config

🔍 Notable Themes

  • Environment handling consistency: The new _coerce_env_value enforces strict typing but introduces a startup crash risk, while the CLI reads environment‑based config, undermining the claim of a deterministic activation report. Consider harmonising env handling by defaulting to safe values and documenting the non‑determinism.
⚠️ **Unanchored Suggestions (Manual Review Recommended)**

The following suggestions could not be precisely anchored to a specific line in the diff. This can happen if the code is outside the changed lines, has been significantly refactored, or if the suggestion is a general observation. Please review them carefully in the context of the full file.


📁 File: src/rules_system_bound/cli.py

Speculative: The CLI activation report reads configuration via get_config() which in turn calls Config.from_env(). This means the report’s output depends on the runtime environment, making it non‑deterministic across different systems. The PR summary claims “deterministic activation report”, but the inclusion of env‑derived config contradicts that claim. If reproducibility is important, consider either freezing the config to defaults or logging a warning that the report may vary.

Suggestion:

config = Config()  # use defaults instead of env

Related Code:

config = get_config()
    return {
        ...
        "config": {
            "domain_family": config.domain_family,
            "primitive_type": config.primitive_type,
            "level_names_emerge": config.level_names_emerge,
        },
    }


💡 Have feedback? We'd love to hear it in our GitHub Discussions.
✨ This review was generated by LlamaPReview Advanced, which is free for all open-source projects. Learn more.

Comment on lines +26 to +27
- name: Run tests
run: python -m pytest -q

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0 | Confidence: High

The CI results in the PR metadata show test jobs failing for Python 3.10 (conclusion: failure) and 3.12 (failure), with the 3.11 job cancelled. Since the new test suite (tests/test_core.py) is the only change that can affect pytest outcome, these failures are directly caused by the PR. This is an immediate build/test failure that blocks merging. The PR itself is marked UNSTABLE. The author must run the tests locally, examine the logs, and fix the regression before the PR can be considered mergeable.

Comment on lines +30 to +36
if isinstance(default, bool):
normalized = value.strip().lower()
if normalized in {"1", "true", "yes", "on"}:
return True
if normalized in {"0", "false", "no", "off"}:
return False
raise ValueError(f"Invalid boolean value: {value!r}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 | Confidence: Medium

The new _coerce_env_value raises a ValueError when an environment‑variable string does not match the expected boolean pattern. Because Config.from_env() does not catch this exception, a production system with a legacy or misconfigured env var (e.g., LEVEL_NAMES_EMERGE=enable) would crash at startup. While this enforces strict typing, it is a breaking change for any deployment that relied on the previous lenient string‑passthrough behaviour. Consider falling back to the default or logging a warning instead of raising.

Code Suggestion:

@classmethod
    def from_env(cls) -> Config:
        config = {}
        for key, default in DEFAULT_CONFIG.items():
            env_key = f"{key.upper()}"
            value = os.getenv(env_key)
            if value is not None:
                try:
                    config[key] = _coerce_env_value(value, default)
                except (ValueError, TypeError):
                    # Log warning and keep default
                    config[key] = default
            else:
                config[key] = default
        return cls(**config)

Evidence: symbol:Config.from_env

Comment thread tests/test_core.py
assert config.container_function == "custom_func"
assert config.domain_family == "social"

def test_config_from_env_preserves_types(self, monkeypatch):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 | Confidence: Low

Speculative: This test may fail if environment variables from other tests or the CI environment leak into from_env() (monkeypatch does not prevent OS‑level env vars from being read when the test runs early). Additionally, the test does not clean up env vars after itself, which could affect subsequent tests. Adding a finalizer or using with monkeypatch.context() would improve isolation.

Suggested change
def test_config_from_env_preserves_types(self, monkeypatch):
def test_config_from_env_preserves_types(self, monkeypatch):
with monkeypatch.context() as m:
m.setenv("CONTAINMENT_FUNCTION_WEIGHT", "0.7")
m.setenv("LEVEL_NAMES_EMERGE", "false")
config = Config.from_env()
assert config.containment_function_weight == 0.7
assert config.level_names_emerge is False

@4444J99
4444J99 enabled auto-merge (squash) June 19, 2026 13:18
limen task RESOLVE-organvm-i-theoria-rules-system-bound-8
@4444J99
4444J99 force-pushed the limen/resolve-organvm-i-theoria-rules-system-bound-8-6f48 branch from d688863 to 73aa510 Compare July 6, 2026 22:48
@4444J99
4444J99 merged commit 7c2f0e0 into main Jul 6, 2026
8 checks passed
@4444J99
4444J99 deleted the limen/resolve-organvm-i-theoria-rules-system-bound-8-6f48 branch July 6, 2026 22:49
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.

1 participant