mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
[sweep] strip Fxxx audit-ID tokens + trim bloated comments/docstrings + add behavior-change docs
Post-audit sweep over the 135 audit-fix commits since19a474d3: 1. Stripped every # Fxxx: audit-ID token from comments AND every Fxxx token from docstring openings across 211 blocks / ~626 lines. The CEO flagged these twice: audit-issue IDs in code confuse future devs/agents. The descriptive text is preserved; only the Fxxx token is removed (and bloated narrative blocks trimmed to 1-3 lines keeping the one non-obvious invariant). 2. Trimmed bloated comments/docstrings to the concise standard (1-3 lines). 3. Added missing behavior-change docs for the audit-fix batch: prompts/roles (documenter, pr_reviewer, qa), user-facing docs (api auth, websockets, agent-gateway, megatask, merge-model, task-lifecycle, grok, resilience, conventions, panel, security, troubleshooting), and the RAG corpus (cell-pm, main-pm, pr-reviewer, qa roles; conventions; messaging-tools; escalation; megatask; task-claiming workflows). Comment/docstring/prose ONLY — zero code-line edits (verified: the diff contains no def/class/return/if/for/await/assignment/call lines). Gates green: ruff format + ruff check clean, mypy clean on roboco/. The only pytest failures are the pre-existing sync_branch tracing-decision gap (B1,250be5c2) — not sweep-caused and tracked separately.
This commit is contained in:
@@ -232,7 +232,7 @@ def test_team_for_slug() -> None:
|
||||
|
||||
|
||||
def test_role_for_slug_or_none_unknown_returns_none() -> None:
|
||||
"""F019/F031: a safe variant for defensive skip-guards — an unknown/stale
|
||||
"""A safe variant for defensive skip-guards — an unknown/stale
|
||||
slug returns None instead of raising KeyError, so a stale assignee or
|
||||
notification-target slug can't crash the whole dispatcher tick."""
|
||||
assert identity.role_for_slug_or_none("nonexistent-slug") is None
|
||||
|
||||
@@ -567,7 +567,7 @@ def test_can_invoke_intent_developer_open_pr_no_commits_tracing_gap() -> None:
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# F101: open_pr must enforce the PR-open state gate (parity with the HTTP path)
|
||||
# open_pr must enforce the PR-open state gate (parity with the HTTP path)
|
||||
# --------------------------------------------------------------------------- #
|
||||
|
||||
|
||||
@@ -584,10 +584,8 @@ def _owned_task(**overrides: Any) -> SimpleNamespace:
|
||||
|
||||
|
||||
def test_open_pr_rejected_on_claimed_task() -> None:
|
||||
"""F101: ``open_pr`` has ``composes=()`` so the spec gate applied NO
|
||||
source-status check — a dev could open a PR from ``claimed`` (before
|
||||
``in_progress``), skipping the active-dev state the HTTP path's
|
||||
``_assert_pr_create_allowed`` enforces. The state gate now rejects it."""
|
||||
"""``open_pr`` must be rejected from ``claimed`` — only ``in_progress`` may
|
||||
open a PR (mirrors the HTTP path's ``_assert_pr_create_allowed``)."""
|
||||
actor = uuid4()
|
||||
d = spec.can_invoke_intent(
|
||||
spec.Role.DEVELOPER,
|
||||
@@ -673,14 +671,8 @@ def test_open_pr_state_gate_takes_priority_over_unowned() -> None:
|
||||
|
||||
|
||||
def test_escalate_up_rejected_on_completed_task() -> None:
|
||||
"""F043: a PM must not resurrect a COMPLETED task via escalate_up.
|
||||
|
||||
escalate_up has composes=() and historically no source-status guard, so the
|
||||
spec gate accepted it on a terminal task and apply_escalation set it back to
|
||||
BLOCKED — bypassing the state machine's terminal-state invariant. The spec
|
||||
now rejects terminal tasks (completed / cancelled) before the journal:decision
|
||||
write fires.
|
||||
"""
|
||||
"""A PM must not resurrect a COMPLETED task via ``escalate_up`` — the spec
|
||||
gate rejects terminal tasks before the journal:decision write fires."""
|
||||
d = spec.can_invoke_intent(
|
||||
spec.Role.CELL_PM,
|
||||
"escalate_up",
|
||||
@@ -692,7 +684,7 @@ def test_escalate_up_rejected_on_completed_task() -> None:
|
||||
|
||||
|
||||
def test_escalate_up_rejected_on_cancelled_task() -> None:
|
||||
"""F043: cancelled is terminal — escalate_up must not resurrect it either."""
|
||||
"""Cancelled is terminal — escalate_up must not resurrect it either."""
|
||||
d = spec.can_invoke_intent(
|
||||
spec.Role.MAIN_PM,
|
||||
"escalate_up",
|
||||
@@ -704,7 +696,7 @@ def test_escalate_up_rejected_on_cancelled_task() -> None:
|
||||
|
||||
|
||||
def test_escalate_up_allowed_on_blocked_task() -> None:
|
||||
"""F043: the terminal guard must not over-restrict — BLOCKED is the natural
|
||||
"""The terminal guard must not over-restrict — BLOCKED is the natural
|
||||
escalation source and must still be allowed."""
|
||||
d = spec.can_invoke_intent(
|
||||
spec.Role.CELL_PM,
|
||||
|
||||
Reference in New Issue
Block a user