workflow: session handover gate 실행환경 모드 분리 (#353) #354

Merged
jihoson merged 7 commits from feature/issue-353-ci-handover-mode-v2 into feature/v3-session-policy-stream 2026-03-01 21:00:52 +09:00
3 changed files with 18 additions and 4 deletions
Showing only changes of commit 6f047a6daf - Show all commits

View File

@@ -25,7 +25,7 @@ jobs:
run: pip install ".[dev]" run: pip install ".[dev]"
- name: Session handover gate - name: Session handover gate
run: python3 scripts/session_handover_check.py --strict run: python3 scripts/session_handover_check.py --strict --ci
- name: Validate governance assets - name: Validate governance assets
env: env:

View File

@@ -22,7 +22,7 @@ jobs:
run: pip install ".[dev]" run: pip install ".[dev]"
- name: Session handover gate - name: Session handover gate
run: python3 scripts/session_handover_check.py --strict run: python3 scripts/session_handover_check.py --strict --ci
- name: Validate governance assets - name: Validate governance assets
env: env:

View File

@@ -66,6 +66,7 @@ def _check_handover_entry(
*, *,
branch: str, branch: str,
strict: bool, strict: bool,
ci_mode: bool,
errors: list[str], errors: list[str],
) -> None: ) -> None:
if not HANDOVER_LOG.exists(): if not HANDOVER_LOG.exists():
@@ -87,7 +88,7 @@ def _check_handover_entry(
if token not in latest: if token not in latest:
errors.append(f"latest handover entry missing token: {token}") errors.append(f"latest handover entry missing token: {token}")
if strict: if strict and not ci_mode:
today_utc = datetime.now(UTC).date().isoformat() today_utc = datetime.now(UTC).date().isoformat()
if today_utc not in latest: if today_utc not in latest:
errors.append( errors.append(
@@ -117,6 +118,14 @@ def main() -> int:
action="store_true", action="store_true",
help="Enforce today-date and current-branch match on latest handover entry.", help="Enforce today-date and current-branch match on latest handover entry.",
) )
parser.add_argument(
"--ci",
action="store_true",
help=(
"CI mode: keep structural/token checks but skip strict "
"today-date/current-branch matching."
),
)
args = parser.parse_args() args = parser.parse_args()
errors: list[str] = [] errors: list[str] = []
@@ -128,7 +137,12 @@ def main() -> int:
elif branch in {"main", "master"}: elif branch in {"main", "master"}:
errors.append(f"working branch must not be {branch}") errors.append(f"working branch must not be {branch}")
_check_handover_entry(branch=branch, strict=args.strict, errors=errors) _check_handover_entry(
branch=branch,
strict=args.strict,
ci_mode=args.ci,
errors=errors,
)
if errors: if errors:
print("[FAIL] session handover check failed") print("[FAIL] session handover check failed")