feat(api): expose onboarding template copy receipt
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 21s
CD Pipeline / build-and-deploy (push) Successful in 8m58s
CD Pipeline / post-deploy-checks (push) Has been cancelled

This commit is contained in:
Your Name
2026-06-30 00:26:30 +08:00
parent ff44598b58
commit 6420f4b1eb
8 changed files with 459 additions and 0 deletions

View File

@@ -352,6 +352,25 @@ def _assert_delivery_workbench_shape(data: dict):
assert data["summary"]["p0_cicd_template_copy_auto_branch_trigger_authorized"] is False
assert data["summary"]["p0_cicd_template_copy_generic_runner_label_authorized"] is False
assert data["summary"]["p0_cicd_template_copy_runner_pressure_guard_required"] is True
assert data["summary"]["p0_cicd_template_copy_receipt_status"] == (
"controlled_template_copy_receipt_ready"
)
assert data["summary"]["p0_cicd_template_copy_receipt_ready"] is True
assert data["summary"]["p0_cicd_template_copy_receipt_active_blocker_count"] == 0
assert data["summary"]["p0_cicd_template_copy_source_template_file_present"] is True
assert (
data["summary"]["p0_cicd_template_copy_destination_workflow_file_present"]
is True
)
assert (
data["summary"]["p0_cicd_template_copy_destination_workflow_matches_template"]
is True
)
assert data["summary"]["p0_cicd_template_copy_workflow_dispatch_declared"] is True
assert data["summary"]["p0_cicd_template_copy_auto_branch_event_count"] == 0
assert data["summary"]["p0_cicd_template_copy_generic_runner_label_count"] == 0
assert data["summary"]["p0_cicd_template_copy_active_workflow_file_created"] is True
assert data["summary"]["p0_cicd_template_copy_workflow_trigger_performed"] is False
assert data["summary"]["production_deploy_status"] == "closure_verified"
assert data["summary"]["production_deploy_image_tag_matches_main"] is True
assert data["summary"]["backup_credential_escrow_intake_status"] == (

View File

@@ -22,6 +22,9 @@ from src.services.awoooi_gitea_onboarding_warning_step_template_copy_apply_gate
from src.services.awoooi_gitea_onboarding_warning_step_template_copy_execution_plan import (
load_latest_awoooi_gitea_onboarding_warning_step_template_copy_execution_plan,
)
from src.services.awoooi_gitea_onboarding_warning_step_template_copy_receipt import (
load_latest_awoooi_gitea_onboarding_warning_step_template_copy_receipt,
)
from src.services.awoooi_new_product_onboarding_page_model import (
load_latest_awoooi_new_product_onboarding_page_model,
)
@@ -276,3 +279,46 @@ def test_warning_step_template_copy_is_fail_closed_and_pressure_guarded():
assert "runs-on: awoooi-non110-host" in workflow
assert 'AWOOOI_ONBOARDING_WARNING_STEP_EXECUTION_ENABLED: "0"' in workflow
assert "ops/runner/guard-gitea-runner-pressure.py --root ." in workflow
def test_template_copy_receipt_loader_confirms_template_copy():
payload = load_latest_awoooi_gitea_onboarding_warning_step_template_copy_receipt()
_assert_template_copy_receipt(payload)
def test_template_copy_receipt_endpoint_returns_controlled_receipt():
app = FastAPI()
app.include_router(router, prefix="/api/v1")
client = TestClient(app)
response = client.get(
"/api/v1/agents/"
"awoooi-gitea-onboarding-warning-step-template-copy-receipt"
)
assert response.status_code == 200
_assert_template_copy_receipt(response.json())
def _assert_template_copy_receipt(payload: dict):
assert (
payload["schema_version"]
== "awoooi_gitea_onboarding_warning_step_template_copy_receipt_v1"
)
assert payload["priority"] == "P0-004"
assert payload["status"] == "controlled_template_copy_receipt_ready"
assert payload["active_blockers"] == []
assert payload["readback"]["template_copy_performed"] is True
assert payload["target_selector"]["active_workflow_file_created"] is True
assert payload["rollups"]["template_file_present"] is True
assert payload["rollups"]["auto_branch_event_count"] == 0
assert payload["rollups"]["generic_runner_label_count"] == 0
assert payload["rollups"]["apply_gate_ready"] is True
assert payload["rollups"]["workflow_trigger_performed"] is False
assert payload["operation_boundaries"]["controlled_template_copy_only"] is True
assert payload["operation_boundaries"]["active_workflow_file_created"] is True
assert payload["operation_boundaries"]["workflow_trigger_performed"] is False
assert payload["operation_boundaries"]["github_api_used"] is False
assert payload["operation_boundaries"]["secret_value_collection_allowed"] is False
assert payload["operation_boundaries"]["raw_session_or_sqlite_read_allowed"] is False