A-SW Hub / Repositories
Local Gitea · READ ONLY
← 저장소 Repositories
REPOSITORY

via/asw-service-platform Private

[참조 MVP] A-SW 공유·협업 서비스 플랫폼 — 컴포넌트 릴리스의 제출·검증·승인·공개 생명주기를 집행하는 플랫폼 코어입니다.

https://git.agrithing.ai/via/asw-service-platform.git
7 commits
COMMIT DETAIL

feat: add executable reference MVP

A-SW Reference Factory <[email protected]> · 2026. 8. 2. 오전 7:38:07
72991eeee0038a8967d7bba535a6400ecbfe4f68
5 changed files +45 −0 parent 0dbe22f
added asw_component/__init__.py +3−0 View file
@@ -0,0 +1,3 @@
1 + from .component import execute
2 +
3 + __all__ = ["execute"]
added asw_component/component.py +18−0 View file
@@ -0,0 +1,18 @@
1 + from __future__ import annotations
2 +
3 + TRANSITIONS = {
4 + ("DRAFT", "submit", "component_owner"): "SUBMITTED",
5 + ("SUBMITTED", "verify", "validator"): "VERIFIED",
6 + ("VERIFIED", "approve", "integration_approver"): "APPROVED",
7 + ("APPROVED", "publish", "release_manager"): "PUBLISHED",
8 + }
9 +
10 + def execute(payload: dict) -> dict:
11 + current = str(payload["current_state"]).upper()
12 + action, role = payload["action"], payload["actor_role"]
13 + if action in {"verify", "approve", "publish"} and int(payload.get("evidence_count", 0)) < 1:
14 + return {"accepted": False, "state": current, "reason": "evidence_required"}
15 + target = TRANSITIONS.get((current, action, role))
16 + if not target:
17 + return {"accepted": False, "state": current, "reason": "transition_not_allowed"}
18 + return {"accepted": True, "previous_state": current, "state": target, "audit_event": f"{current}:{action}:{role}:{target}"}
added examples/input.json +6−0 View file
@@ -0,0 +1,6 @@
1 + {
2 + "current_state": "VERIFIED",
3 + "action": "approve",
4 + "actor_role": "integration_approver",
5 + "evidence_count": 4
6 + }
added pyproject.toml +8−0 View file
@@ -0,0 +1,8 @@
1 + [project]
2 + name = "asw_service_platform"
3 + version = "0.1.0"
4 + description = "컴포넌트 릴리스의 제출·검증·승인·공개 생명주기를 집행하는 플랫폼 코어입니다."
5 + requires-python = ">=3.11"
6 +
7 + [tool.unittest]
8 + test-path = "tests"
added run.py +10−0 View file
@@ -0,0 +1,10 @@
1 + from __future__ import annotations
2 + import json
3 + import sys
4 + from asw_component import execute
5 +
6 + if __name__ == "__main__":
7 + path = sys.argv[1] if len(sys.argv) > 1 else None
8 + with open(path, encoding="utf-8") if path else sys.stdin as source:
9 + payload = json.load(source)
10 + print(json.dumps(execute(payload), ensure_ascii=False, indent=2))