molecule-core/org-templates/molecule-dev
Hongming Wang 54b49ffd1b fix(code-review): idle loop hardening + idle_prompt docs + admin-auth runbook
Addresses items 4, 5, 7 from the self-review of the batch merge. PR A
(#228) covered items 1, 2, 3, 6 on the Go side.

## workspace-template/main.py — idle loop hardening

- Replace asyncio.get_event_loop() with asyncio.get_running_loop() —
  the former is deprecated in 3.12+ and emits a DeprecationWarning on
  every idle fire.
- Replace hardcoded urlopen timeout=600 with IDLE_FIRE_TIMEOUT_SECONDS
  clamped to max(60, min(300, idle_interval_seconds)). Long cadence
  workspaces no longer hold dangling requests open for 10 minutes; the
  cap adapts automatically when the interval is short.
- Type the exception handling: split HTTPError (has .code) from URLError
  (connection-level) from the generic catch-all. Log status + error
  class separately so operators can grep for specific failure modes
  instead of a bare "post failed".
- Fire-and-forget no longer loses exceptions. run_in_executor Future
  now has an add_done_callback that logs the outcome, so a panic in
  _post_sync surfaces as "Idle loop: post failed — status=None err=..."
  instead of Python's default "Task exception was never retrieved"
  warning burried in stderr.

## org-templates/molecule-dev/org.yaml — discoverability

Added idle_prompt + idle_interval_seconds to the defaults: block with
explanatory comments. Without this, users had to read main.py to
discover the feature.

## docs/runbooks/admin-auth.md — new

Documents the three middleware variants (AdminAuth strict,
CanvasOrBearer soft, WorkspaceAuth per-id), the exact contract of each,
and the three-question test for adding a new route to CanvasOrBearer.
Also flags the session-cookie follow-up as Phase H.

Referenced PRs: #138, #164, #165, #166, #167, #168, #190, #194, #203,
#228.

No code deltas in platform/ beyond the Python + YAML + docs changes.
Full pytest suite unchanged except the pre-existing test_hermes_smoke
flake that fails in full-suite but passes in isolation (test isolation
bug, not introduced by this PR).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 11:52:01 -07:00
..
backend-engineer initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
competitive-intelligence initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
dev-lead initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
devops-engineer initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
documentation-specialist fix(template): add missing documentation-specialist/system-prompt.md (closes #177) 2026-04-15 17:23:38 +00:00
frontend-engineer initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
market-analyst initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
pm feat(platform): generic category_routing replaces hardcoded audit dispatch (#51) 2026-04-14 14:06:47 -07:00
qa-engineer initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
research-lead initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
security-auditor initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
technical-researcher initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
uiux-designer initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
.env.example initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
org.yaml fix(code-review): idle loop hardening + idle_prompt docs + admin-auth runbook 2026-04-15 11:52:01 -07:00