Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ jobs:
PY
- run: uv run --locked python .claude/scripts/check_secret_policy.py docs/dev/secret-policy.md
- run: uv run --locked python .claude/scripts/check_session_recording_policy.py docs/dev/session-recording-policy.md
- name: Check InputCommand docs schema
run: uv run --locked python scripts/check_input_command_schema.py
- run: uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py .claude/skills/edit-issue/tests/test_guard_issue_body.py
- run: uv run --locked pytest .claude/skills/create-issue/tests/
- run: uv run --locked pytest .claude/skills/create-issue/scripts/tests/
Expand Down
39 changes: 39 additions & 0 deletions scripts/check_input_command_schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""
Validate the InputCommand TypeScript code block in docs/product/game-logic.md.

This script checks the documented token set for the current move/aim/fire schema.
It does not parse src/input/InputMapper.ts.

Exit 0 on success, non-zero on failure.
"""
from pathlib import Path
import re
import sys

s = Path("docs/product/game-logic.md").read_text(encoding="utf-8")
section = re.search(r"^## 入力 / Input\b(?P<body>.*?)(?=^## |\Z)", s, re.S | re.M)
if not section:
raise SystemExit("## 入力 / Input section not found")
m = re.search(r"```typescript\n(.*?)```", section.group("body"), re.S)
if not m:
raise SystemExit("InputCommand TypeScript block not found in ## 入力 / Input section")

block = m.group(1)
normalized = re.sub(r"\s+", " ", block)

required = [
"{ type: 'move'; axisX: number; axisY: number",
"{ type: 'aim'; x: number; y: number",
"{ type: 'fire'",
]
for token in required:
if token not in normalized:
raise SystemExit(f"missing required token: {token}")

for forbidden in [
"MoveIntent", "AimIntent", "FireIntent",
"IssueAllyCommandIntent", "PauseIntent",
"direction: Vec2", "angle:",
]:
if forbidden in block:
raise SystemExit(f"forbidden token remains in code block: {forbidden}")
Loading