Lift the two HUMAN gates that block an autonomous batch run (epic ORCH-088):
the BRD gate (analysis: manual Approved) and the prod-deploy gate (deploy
Phase A: manual Confirm Deploy, ORCH-059). Selective (a Plane label on the
issue), declarative, reversible, and WITHOUT touching a single technical check.
Additive, mirroring the conditional sub-gates (ORCH-035/043/058/088): leaf
src/labels.py (never-raise) + two point insertions + config flags.
STAGE_TRANSITIONS / QG_CHECKS / check_* / DB schema are NOT touched.
- autoApprove: врезка in _handle_analysis_approved_flow (files_ok branch) ->
set_issue_approved + log/Telegram/Plane-comment + advance_stage(
finished_agent=None) — the SAME path a human Approved takes (approved-via-
status -> analysis->architecture + mark_brd_review_ended). No duplicated
transition logic; re-entrancy safe.
- autoDeploy: врезка in _handle_self_deploy_phase_a after advance to deploy +
clear_state -> log/Telegram/Plane-comment + _handle_self_deploy_phase_b
(INITIATED marker, Deploying, finalizer). Only the indicative human steps are
skipped. BR-5 holds structurally: Phase A is reached only after the green edge
sub-gates, so autoDeploy can never deploy a broken build.
- plane_sync: fetch_issue_labels (None on error != []), get_project_labels
({normalized_name->uuid}, TTL cache, ambiguity sentinel), set_issue_approved.
- config flags: auto_label_enabled (kill-switch), auto_approve_label/
auto_deploy_label, auto_label_repos (empty -> self-hosting only),
auto_label_states_ttl_s. applies() (local) checked FIRST; has_label (network)
only when applies==True -> zero network / zero regression when disabled (AC-8).
- Fail-safe (never auto on doubt), transparency via log+Telegram+Plane+card,
read-only auto_labels block in GET /queue.
- Tests TC-01..TC-26 across 7 modules; docs (CLAUDE.md, architecture README,
CHANGELOG) updated in the same PR.
Refs: ORCH-089
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
34 lines
1.4 KiB
Python
34 lines
1.4 KiB
Python
"""ORCH-089 — TC-26: invariant registries are NOT touched by the auto-label work.
|
|
|
|
The auto-mode reuses existing transitions/gates and only removes the wait for a
|
|
human signal; it must not add a stage, a transition, or a QG check (TRZ §10 / AC-10).
|
|
"""
|
|
import os
|
|
import tempfile
|
|
|
|
os.environ.setdefault("ORCH_DB_PATH", os.path.join(tempfile.gettempdir(), "test_auto_inv.db"))
|
|
os.environ.setdefault("ORCH_GITEA_TOKEN", "test-token")
|
|
os.environ.setdefault("ORCH_PLANE_API_TOKEN", "test-token")
|
|
|
|
|
|
def test_tc26_stage_transitions_unchanged():
|
|
from src.stages import STAGE_TRANSITIONS
|
|
assert set(STAGE_TRANSITIONS) == {
|
|
"created", "analysis", "architecture", "development", "review",
|
|
"testing", "deploy-staging", "deploy", "done",
|
|
}
|
|
# The two human gates still use their existing QG names (unchanged).
|
|
assert STAGE_TRANSITIONS["analysis"]["qg"] == "check_analysis_approved"
|
|
|
|
|
|
def test_tc26_no_new_qg_check():
|
|
from src.qg.checks import QG_CHECKS
|
|
# No auto-label / auto-approve / auto-deploy QG check was introduced — the
|
|
# auto-mode is a decision врезка, not a registered quality gate.
|
|
assert not any(
|
|
tok in k for k in QG_CHECKS for tok in ("auto_label", "autoapprove", "autodeploy")
|
|
), "ORCH-089 must not register a new QG check"
|
|
# The gates it reuses are present and untouched.
|
|
for k in ("check_analysis_approved", "check_deploy_status", "check_staging_status"):
|
|
assert k in QG_CHECKS
|