Skip to content

chore(template): audit crons require PM-routing + GH-issue filing; add UIUX schedule - #26

Merged
HongmingWang-Rabbit merged 1 commit into
mainfrom
chore/template-audit-cron-routing
Apr 14, 2026
Merged

chore(template): audit crons require PM-routing + GH-issue filing; add UIUX schedule#26
HongmingWang-Rabbit merged 1 commit into
mainfrom
chore/template-audit-cron-routing

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Summary

Audit agents (Security, QA, UIUX) were running their crons successfully but findings stayed trapped in agent memory — they didn't consistently flow into GitHub issues or reach developers with build ability. This PR rewrites the three audit cron prompts so the post-audit delivery is mandatory, structured, and routed through PM.

Motivation

Incident seen 2026-04-13 evening: Security Auditor had 13 open critical findings in its memory including an unauthenticated-plugin-install RCE (plugins_registry/builtins.py:163-184). BE picked up a batch earlier in the day as a one-off escalation, then went idle while findings continued to accumulate silently. UIUX Designer was similarly stuck — screenshots unavailable due to missing container libs (#23), falling back to HTML analysis, but no one saw the output.

Root cause: the cron prompts treated post-audit delegation as optional ("if you find issues, report to Dev Lead") and wrote to memory as the primary deliverable. Memory is invisible unless someone reads it.

Changes

  1. Security Auditor — replace 12h schedule (7 6,18 * * *) with hourly (17 * * * *) to match what's actually in the platform DB. Backfill the full hourly prompt into the template (see Runtime-added workspace_schedules drift from org-template — template is not source of truth #24 for the separate template-vs-runtime drift fix).

  2. QA Engineer — keep 12h cadence; tighten the post-audit routing.

  3. UIUX Designer — add a schedule block (was previously runtime-only; see Runtime-added workspace_schedules drift from org-template — template is not source of truth #24). Uses hourly cadence. Accepts that Playwright may be unavailable (UIUX Designer workspace image missing X11/glib — Playwright screenshots fail in audit cron #23) and falls back to HTML analysis, explicitly noting the limitation in the PM deliverable.

  4. Shared routing contract — all three audit crons now end with an identical FINAL STEP — DELIVERABLE ROUTING (MANDATORY every cycle) block:

    • (a) For each CRITICAL/HIGH finding, gh issue create with dedup against open issues. Capture issue numbers.
    • (b) delegate_task to PM with a structured summary (timestamp/SHA, findings by severity, issue numbers, top recommendation). PM owns cross-team routing; audit agents don't DM Dev Lead directly.
    • (c) Even on CLEAN cycles: delegate_task PM a one-line "clean on SHA X" so audits are observable instead of silent.
    • (d) Memory write is a secondary record, not the primary deliverable.

Design rationale

  • GitHub issues as the source of truth for audit findings — durable, searchable, reviewable, and already wired into the review-agent feedback loop.
  • PM as router — respects the existing org hierarchy; PM already knows who's free and what's in flight. Auditors shouldn't second-guess that.
  • Clean cycle still reports — silent clean cycles are indistinguishable from broken audits. One-line ping keeps observability honest.

Related issues

Test plan

  • python -c "import yaml; yaml.safe_load(open('org-templates/molecule-dev/org.yaml'))" — YAML valid.
  • After merge + re-import: workspace_schedules table should show Security Auditor on 17 * * * * and UIUX Designer present with 11 * * * *.
  • Next Security cron run: delegations to PM visible in GET /workspaces/<PM>/delegations and/or new GH issues filed.
  • Next UIUX cron run: same observable routing.

🤖 Generated with Claude Code

…add UIUX schedule

Addresses the gap surfaced by CEO 2026-04-13: audit agents (Security
Auditor, QA Engineer, UIUX Designer) were running their crons successfully
but findings stayed in agent memory and didn't consistently flow to
GitHub issues or to developers with build ability. BE noticed Security
findings once via a manual escalation; subsequent hourly audits
accumulated 13 criticals (including an unauthenticated-plugin-install
RCE) with no durable tracking.

Changes:
1. Security Auditor schedule: replace 12h (7 6,18 * * *) with hourly
   (17 * * * *) to match what's actually running in the platform DB.
   Rewrite the prompt with the full body of the runtime cron — git diff
   scoping, gosec/bandit, manual checklist, live API DAST, secrets scan,
   open-PR review.
2. QA Engineer schedule: keep 12h cadence, tighten post-audit routing.
3. UIUX Designer: add a schedule (was previously runtime-only — see #24).
   Uses hourly cadence to match runtime. Accepts Playwright may be
   unavailable (see #23) and falls back to HTML analysis with the
   limitation noted in the deliverable.

All three audit crons now end with an identical FINAL STEP — DELIVERABLE
ROUTING block that makes the post-audit flow MANDATORY:

  a. File a GitHub issue for each CRITICAL / HIGH finding (dedupe first)
  b. delegate_task to PM with a structured summary listing issue numbers;
     PM decides which dev agent picks up which issue
  c. Even on clean cycles, send PM a one-line "clean on SHA X" so audits
     are observable
  d. Memory write becomes a secondary record, not the primary deliverable

Rationale: findings need to flow into the issue tracker (durable, visible
to CEO, part of the PR/issue review feedback loop already in place) and
through PM (who owns cross-team orchestration). Memory-only output is
invisible to everyone except the auditor itself.

Related:
- #23 — UIUX Designer container missing libglib/X11 for Playwright.
  This PR accepts the current limitation; #23 tracks the image fix.
- #24 — template-vs-runtime schedule drift. This PR backfills the template;
  #24 tracks the platform-layer fix for preventing future drift.
- 13 open criticals in Security Auditor memory are out of scope for this
  PR (that's team work once the routing is in place).
@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor Author

7-gate verification passed.

Gate 1 (CI): 6/6 green.
Gate 2 (build): YAML-only (org-templates/molecule-dev/org.yaml) — skipped cleanly.
Gate 3 (tests): YAML-only — skipped cleanly.
Gate 4 (security): No committed secrets, no new env vars. Token-pattern grep scans commits (safe); gh uses agent's own auth.
Gate 5 (design fit): PM-routing via delegate_task aligns with 'delegate through PM, never bypass hierarchy'. GH-issue filing uses 'gh issue create' only — no auto-close, no destructive ops. Dedup-before-create prevents spam. Clean cycles still route to PM for observability.
Gate 6 (line review): Hourly crons (:17 security, :11 UIUX) — busy but not every-minute noisy. gh calls scoped to list/create/diff — no 'gh repo delete', no --force, no auto-close.
Gate 7 (canvas): No canvas files — skipped.

Verdict: merge.

@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit a97dfc6 into main Apr 14, 2026
6 checks passed
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the chore/template-audit-cron-routing branch April 14, 2026 04:30
HongmingWang-Rabbit added a commit that referenced this pull request Apr 14, 2026
…ifacts

Follow-up to root-cause analysis in #17 (see 2026-04-14 02:14 UTC comment).

The Security Auditor's hourly DAST was creating test workspaces, secrets,
and plugins to probe auth/validation logic — but only secrets and plugins
had teardown in the prompt. Workspace-create probes leaked rows into
`workspaces` with sequential IDs aaaaaaaa- bbbbbbbb- cccccccc- dddddddd-,
each trapped in a restart loop on missing config.yaml. Four hourly runs,
four leaked workspaces.

Adds explicit step 4a: DAST TEARDOWN. Maintains three lists (workspaces,
secrets, plugins) populated as probes run, and iterates them at the end
with DELETE calls. Uses `|| true` so partial teardown failures don't
break the audit, but every created artifact gets a cleanup attempt.

Doesn't remove the cleanup the cron was already doing for secrets/plugins
— just formalises the pattern so workspace-create (and any future probe
surface) is covered by the same contract.

Related:
- #17 — rogue workspace restart loop (root cause was this)
- #26 — audit cron routing (this PR sits alongside that structure)
HongmingWang-Rabbit added a commit that referenced this pull request Apr 14, 2026
… triggers, not FYIs

Observed 2026-04-14 morning: audit crons (Security, UIUX, QA) were flowing
messages into PM per the PR #26 contract, but PM stopped sub-delegating to
Dev Lead ~10 hours ago. Meanwhile audits started opening PRs directly
(bypassing Dev Lead), and Dev Lead / BE / FE / DevOps / QA sat idle for
17+ maintenance cycles despite PRs continuing to land.

Root cause: PM's system prompt defined delegation behavior for "tasks from
CEO" but didn't explicitly treat audit summaries as tasks. PM was reading
"audit of SHA X, filed issue #N, top recommendation: fix Y" as a status
report and committing it to memory without triggering the dispatch chain.

Adds a dedicated "Audit Routing" section to PM's prompt that:
- Treats every audit summary with open issue numbers as a dispatch trigger
- Specifies routing by category (security→BE, ui→FE, infra→DevOps, qa→QA)
- Requires parallel `delegate_task_async` when issues span categories
- Makes clean-cycle acks the only no-op case

This turns PM from a receptionist into a dispatcher — which was the
original intent of the audit-routing contract in #26.

Aligns with the north-star goal (keep the team running 24/7): dead idle
windows when audits had live issue numbers is a defect in orchestration,
not a quiet period.
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
…ting

chore(template): audit crons require PM-routing + GH-issue filing; add UIUX schedule
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
…ifacts

Follow-up to root-cause analysis in #17 (see 2026-04-14 02:14 UTC comment).

The Security Auditor's hourly DAST was creating test workspaces, secrets,
and plugins to probe auth/validation logic — but only secrets and plugins
had teardown in the prompt. Workspace-create probes leaked rows into
`workspaces` with sequential IDs aaaaaaaa- bbbbbbbb- cccccccc- dddddddd-,
each trapped in a restart loop on missing config.yaml. Four hourly runs,
four leaked workspaces.

Adds explicit step 4a: DAST TEARDOWN. Maintains three lists (workspaces,
secrets, plugins) populated as probes run, and iterates them at the end
with DELETE calls. Uses `|| true` so partial teardown failures don't
break the audit, but every created artifact gets a cleanup attempt.

Doesn't remove the cleanup the cron was already doing for secrets/plugins
— just formalises the pattern so workspace-create (and any future probe
surface) is covered by the same contract.

Related:
- #17 — rogue workspace restart loop (root cause was this)
- #26 — audit cron routing (this PR sits alongside that structure)
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
… triggers, not FYIs

Observed 2026-04-14 morning: audit crons (Security, UIUX, QA) were flowing
messages into PM per the PR #26 contract, but PM stopped sub-delegating to
Dev Lead ~10 hours ago. Meanwhile audits started opening PRs directly
(bypassing Dev Lead), and Dev Lead / BE / FE / DevOps / QA sat idle for
17+ maintenance cycles despite PRs continuing to land.

Root cause: PM's system prompt defined delegation behavior for "tasks from
CEO" but didn't explicitly treat audit summaries as tasks. PM was reading
"audit of SHA X, filed issue #N, top recommendation: fix Y" as a status
report and committing it to memory without triggering the dispatch chain.

Adds a dedicated "Audit Routing" section to PM's prompt that:
- Treats every audit summary with open issue numbers as a dispatch trigger
- Specifies routing by category (security→BE, ui→FE, infra→DevOps, qa→QA)
- Requires parallel `delegate_task_async` when issues span categories
- Makes clean-cycle acks the only no-op case

This turns PM from a receptionist into a dispatcher — which was the
original intent of the audit-routing contract in #26.

Aligns with the north-star goal (keep the team running 24/7): dead idle
windows when audits had live issue numbers is a defect in orchestration,
not a quiet period.
HongmingWang-Rabbit pushed a commit that referenced this pull request Jun 12, 2026
Both tutorials cited misattributed PRs and claimed shipped runtimes that
didn't exist (RFC internal#730 finding):
- google-adk-runtime.md: cited 'PR #550' (actually a MemoryTab test suite) +
  'already first-class'. Rewritten to the REAL implementation — ADK engine-only
  (google-adk[mcp]==2.1.0, no [a2a]), Vertex AI via ADC (keyless), a2a-1.x
  bridge — with correct PR refs (template PR #1, core #2003, ci #26) + a
  landing-status banner.
- gemini-cli-runtime.md: cited 'PR #379' (actually CI cleanup); no gemini-cli
  runtime exists in manifest/knownRuntimes. Added a correction banner pointing
  to the real google-adk runtime.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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