Skip to content

docs: finalize v7.61 deployment guide and architecture overhaul#20

Merged
dsecurity49 merged 3 commits into
mainfrom
docs/v7.61-deployment-guide
May 24, 2026
Merged

docs: finalize v7.61 deployment guide and architecture overhaul#20
dsecurity49 merged 3 commits into
mainfrom
docs/v7.61-deployment-guide

Conversation

@dsecurity49
Copy link
Copy Markdown
Owner

@dsecurity49 dsecurity49 commented May 24, 2026

  • Added deployment capacity and Docker benchmarks to README
  • Promoted SPEC.md status to Stable with operational characteristics
  • Added benchmarking instructions to CONTRIBUTING.md
  • Documented worker deployment scenarios in Examples/README.md
  • Added deployment security guidelines to SECURITY.md
  • Added Enterprise Stress Suite (stest_ui.py) to tests/
  • Scrubbed legacy URLs from example worker scripts

Summary by CodeRabbit

  • New Features

    • Added a comprehensive stress-test/benchmark suite for validating deployment performance.
  • Documentation

    • Added "Performance & Reliability (v7.61)" benchmarks, capacity guidance, and known limits.
    • New deployment scenarios, checklist, and contributor guidance for running benchmarks.
    • Enhanced deployment security guidance (including /metrics authentication) and a warning against PythonAnywhere free tier.
    • Updated examples and README to use Render-based base URLs and added BUS_TRUST_PROXY env guidance.
  • Chores

    • Updated default base URLs in example scripts.

Review Change Stack

- Added deployment capacity and Docker benchmarks to README
- Promoted SPEC.md status to Stable with operational characteristics
- Added benchmarking instructions to CONTRIBUTING.md
- Documented worker deployment scenarios in Examples/README.md
- Added deployment security guidelines to SECURITY.md
- Added Enterprise Stress Suite (stest_ui.py) to tests/
- Scrubbed legacy URLs from example worker scripts
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

📝 Walkthrough

Walkthrough

This PR marks the protocol stable for v7.61, adds deployment/performance/security documentation and example updates pointing to a Render host, extends contribution docs with stress-test instructions, and introduces a full stress-testing suite with live dashboarding and JSONL/JSON reporting.

Changes

v7.61 Deployment, Performance & Testing Infrastructure

Layer / File(s) Summary
v7.61 Specification & Operational Validation
SPEC.md
RFC Intent Protocol v2.1 marked Stable; v7.61 operational characteristics documented (throughput, latency, success rate, default lease duration); explicit MUST NOT constraints added (no job loss on shutdown, no lease hijacking, timestamp validation when HMAC enabled).
Deployment Capacity, Performance & Security Documentation
README.md, SECURITY.md, CHANGELOG.md, Examples/README.md
Adds "Deployment Capacity & Performance (v7.61)" with benchmark tables and deployment recommendations; SECURITY.md adds Deployment Security and /metrics protection guidance; CHANGELOG records v7.61 validation results; Examples/README adds deployment scenarios and a checklist; BUS_TRUST_PROXY env var documented; minor README formatting edits.
Endpoint Defaults & Example URL Updates
worker.sh, Examples/discord_worker.sh, logger.sh, README.md
Default BASE_URL fallbacks migrated from the PythonAnywhere host to the Render endpoint across worker/logger/example scripts; README curl and claim/fulfill examples updated to use the Render host.
Contribution: Run Benchmarks & Stress Tests
CONTRIBUTING.md
New section describing how to install test deps, run the stress suite, expected success-rate/throughput targets for low/medium/high scenarios, and what to include in PR reports.
Comprehensive Stress Testing Suite
tests/stest_ui.py
Adds Intent Bus Real-World Stress Suite v2: CLI, profiles (low/medium/high), API-key loading, DiagnosticsLogger (JSONL/JSON reports), thread-safe Metrics, scoring utilities, LiveDashboard ANSI renderer, publisher and runtime workers with turbulence/fault-injection, run orchestration with signal handling and hard timeouts, comparison matrix for multi-profile runs, and log cleanup.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through spec and tests tonight,
docs polished, benchmarks set alight.
Dashboards hum and stress suites run,
Render endpoints gleam beneath the sun.
Intent Bus hops onward — fast and bright!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objectives: finalizing v7.61 deployment documentation and architecture updates across multiple files (README, SPEC, CONTRIBUTING, SECURITY, examples, and tests).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/v7.61-deployment-guide

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

Comment thread worker.sh
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
README.md (1)

376-405: ⚡ Quick win

Align deployment guidance with architecture diagram to avoid mixed hosting signals.

Line 380+ positions Docker/Render as the validated deployment path, but the architecture diagram still labels PythonAnywhere. Please update the diagram host label so docs don’t present conflicting defaults.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 376 - 405, The architecture diagram label still shows
"PythonAnywhere" which conflicts with the README's validated deployment
recommendation of Docker/Render; update the architecture diagram graphic (the
host label text in the diagram asset referenced by the README) to reflect the
recommended deployment (e.g., "Docker/Render" or a neutral "Cloud Platform") so
the diagram matches the Docker/docker-compose guidance, and ensure any alt
text/caption in README.md that references the diagram is updated to the same
host label.
tests/stest_ui.py (2)

440-443: 💤 Low value

Broad Exception catches are intentional but could mask unexpected bugs.

The bare Exception handlers (lines 440, 537) prevent worker crashes during stress tests, which is reasonable. However, consider logging the exception type in addition to the message to aid debugging if unexpected errors occur.

♻️ Optional: Include exception type in log
             except Exception as e:
                 metrics.inc("err_unknown")
-                logger.log_event("publish_unknown_error", {"error": str(e)})
+                logger.log_event("publish_unknown_error", {"error": str(e), "type": type(e).__name__})
                 time.sleep(0.5)

Also applies to: 537-541

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/stest_ui.py` around lines 440 - 443, Update the broad except blocks
that currently do metrics.inc("err_unknown") and call
logger.log_event("publish_unknown_error", {"error": str(e)}) so the logged
payload also includes the exception type; for example, augment the
logger.log_event call to include type(e).__name__ (and optionally full module
path) alongside the message, and apply this change to both except Exception as e
handlers (the one around logger.log_event("publish_unknown_error") and the
similar handler at lines ~537) so the logs contain both error message and
exception type for easier debugging.

62-74: 💤 Low value

Defer API key loading to avoid module-level side effects.

Loading API_KEY at module level (line 74) causes SystemExit on import if ~/.apikey is missing. This prevents importing the module for testing or tooling purposes. Consider lazy initialization or moving the call into run_profile().

♻️ Proposed refactor: Lazy initialization
-API_KEY = get_api_key()
+API_KEY: str | None = None
+
+def _get_api_key() -> str:
+    global API_KEY
+    if API_KEY is None:
+        API_KEY = get_api_key()
+    return API_KEY

Then update IntentClient instantiation in workers to use _get_api_key().

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/stest_ui.py` around lines 62 - 74, The module currently calls
get_api_key() at import time (API_KEY = get_api_key()) which raises SystemExit
if ~/.apikey is missing; change this to defer loading by removing the
module-level API_KEY and adding a lazy accessor (e.g. _get_api_key() or make
get_api_key() only invoked at runtime), then update all call sites (for example
where IntentClient is instantiated in workers and any use in run_profile()) to
call the lazy accessor at runtime instead of importing API_KEY at module import
time so importing the module no longer produces side effects.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 435: Fix the README entry for BUS_TRUST_PROXY: correct the typo and
improve formatting by changing the description text to read "For servers behind
proxies; set to 'true'." Make sure the variable name BUS_TRUST_PROXY remains
unchanged and update the casing and punctuation so it matches other entries in
the table.

In `@tests/stest_ui.py`:
- Around line 744-751: The -h short flag for the high-intensity profile
conflicts with argparse help; change the group.add_argument call that currently
uses "-h", "--high" to use a non-conflicting short option (e.g. "-H") and a
clearer long name (e.g. "--high-only" or "--high") so the signature becomes
something like "-H", "--high-only" and update any code that checks for args.high
accordingly; after switching the short flag you can also remove add_help=False
and the manual "--help" argument (if present) to restore argparse's default help
handling.

---

Nitpick comments:
In `@README.md`:
- Around line 376-405: The architecture diagram label still shows
"PythonAnywhere" which conflicts with the README's validated deployment
recommendation of Docker/Render; update the architecture diagram graphic (the
host label text in the diagram asset referenced by the README) to reflect the
recommended deployment (e.g., "Docker/Render" or a neutral "Cloud Platform") so
the diagram matches the Docker/docker-compose guidance, and ensure any alt
text/caption in README.md that references the diagram is updated to the same
host label.

In `@tests/stest_ui.py`:
- Around line 440-443: Update the broad except blocks that currently do
metrics.inc("err_unknown") and call logger.log_event("publish_unknown_error",
{"error": str(e)}) so the logged payload also includes the exception type; for
example, augment the logger.log_event call to include type(e).__name__ (and
optionally full module path) alongside the message, and apply this change to
both except Exception as e handlers (the one around
logger.log_event("publish_unknown_error") and the similar handler at lines ~537)
so the logs contain both error message and exception type for easier debugging.
- Around line 62-74: The module currently calls get_api_key() at import time
(API_KEY = get_api_key()) which raises SystemExit if ~/.apikey is missing;
change this to defer loading by removing the module-level API_KEY and adding a
lazy accessor (e.g. _get_api_key() or make get_api_key() only invoked at
runtime), then update all call sites (for example where IntentClient is
instantiated in workers and any use in run_profile()) to call the lazy accessor
at runtime instead of importing API_KEY at module import time so importing the
module no longer produces side effects.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6034c6a5-18b6-45d9-8af9-eee57ad9a172

📥 Commits

Reviewing files that changed from the base of the PR and between d329323 and 4db4843.

📒 Files selected for processing (10)
  • CHANGELOG.md
  • CONTRIBUTING.md
  • Examples/README.md
  • Examples/discord_worker.sh
  • README.md
  • SECURITY.md
  • SPEC.md
  • logger.sh
  • tests/stest_ui.py
  • worker.sh

Comment thread README.md Outdated
Comment thread tests/stest_ui.py
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
README.md (1)

435-436: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Polish BUS_TRUST_PROXY row text and table spacing.

The description still has inconsistent casing, and the table block likely still violates markdownlint spacing before the horizontal rule.

Suggested doc fix
-| `BUS_TRUST_PROXY` | — | For Servers behind proxies; set to 'true'|
+| `BUS_TRUST_PROXY` | — | For servers behind proxies; set to 'true'. |
+
 ---
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 435 - 436, Update the BUS_TRUST_PROXY table row to
use consistent sentence casing and fix markdown table spacing before the
horizontal rule: change the description cell for the `BUS_TRUST_PROXY` row to
"For servers behind proxies; set to 'true'." (sentence case) and ensure there is
a blank line before the table separator line (the --- row) so the table complies
with markdownlint spacing rules; locate and edit the table row containing
`BUS_TRUST_PROXY` to apply these changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@README.md`:
- Around line 435-436: Update the BUS_TRUST_PROXY table row to use consistent
sentence casing and fix markdown table spacing before the horizontal rule:
change the description cell for the `BUS_TRUST_PROXY` row to "For servers behind
proxies; set to 'true'." (sentence case) and ensure there is a blank line before
the table separator line (the --- row) so the table complies with markdownlint
spacing rules; locate and edit the table row containing `BUS_TRUST_PROXY` to
apply these changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 481e79f0-d901-44c9-b3ec-9b4a702a1a53

📥 Commits

Reviewing files that changed from the base of the PR and between 4db4843 and fe73bcd.

📒 Files selected for processing (1)
  • README.md

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 1 file(s) based on 1 unresolved review comment.

Files modified:

  • tests/stest_ui.py

Commit: 24357d8ddb151b17b201d0e84a8e9c156eb39194

The changes have been pushed to the docs/v7.61-deployment-guide branch.

Time taken: 2m 32s

Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/stest_ui.py (1)

62-74: ⚡ Quick win

Module-level API key loading blocks import without ~/.apikey.

Executing get_api_key() at import time means the module cannot be imported for testing, documentation, or any other purpose without ~/.apikey present. Consider lazy initialization or environment variable fallback.

♻️ Suggested refactor: lazy initialization
-API_KEY = get_api_key()
+_API_KEY: str | None = None
+
+def get_api_key_cached() -> str:
+    global _API_KEY
+    if _API_KEY is None:
+        _API_KEY = get_api_key()
+    return _API_KEY

Then update usages in publisher_worker and runtime_worker:

-    client = IntentClient(base_url=BASE_URL, api_key=API_KEY, timeout=30)
+    client = IntentClient(base_url=BASE_URL, api_key=get_api_key_cached(), timeout=30)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/stest_ui.py` around lines 62 - 74, The module currently calls
get_api_key() at import-time which raises SystemExit if ~/.apikey is missing,
blocking imports; change to lazy initialization and fallback to an environment
variable: update get_api_key to return None or raise only when explicitly
requested, add a new accessor function (e.g., fetch_api_key() or
get_api_key_or_raise()) that checks os.environ["API_KEY"] before reading
Path.home()/".apikey" and only raises SystemExit when called by runtime
entrypoints; replace the module-level API_KEY constant with a lazily-evaluated
lookup used in publisher_worker and runtime_worker so tests/docs can import the
module without the file present.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/stest_ui.py`:
- Around line 62-74: The module currently calls get_api_key() at import-time
which raises SystemExit if ~/.apikey is missing, blocking imports; change to
lazy initialization and fallback to an environment variable: update get_api_key
to return None or raise only when explicitly requested, add a new accessor
function (e.g., fetch_api_key() or get_api_key_or_raise()) that checks
os.environ["API_KEY"] before reading Path.home()/".apikey" and only raises
SystemExit when called by runtime entrypoints; replace the module-level API_KEY
constant with a lazily-evaluated lookup used in publisher_worker and
runtime_worker so tests/docs can import the module without the file present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b613b0af-514c-4385-8a71-defcd296b36f

📥 Commits

Reviewing files that changed from the base of the PR and between fe73bcd and 24357d8.

📒 Files selected for processing (1)
  • tests/stest_ui.py

@dsecurity49 dsecurity49 merged commit 369043b into main May 24, 2026
7 checks passed
@dsecurity49 dsecurity49 deleted the docs/v7.61-deployment-guide branch May 24, 2026 13:54
This was referenced May 25, 2026
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