diff --git a/README.md b/README.md index ac04dc4..5dcf302 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ Some specifications in this repository describe FICTIONAL drug, disease, and cli - **仕様書を実装から分離** — アプリや関連サービスから参照する仕様・設計メモを独立管理 - **アプリ単位で仕様を整理** — プロジェクトごとにディレクトリを分け、画面仕様、データモデル、API 契約、永続化スキーマを配置 - **契約ファイルを同梱** — OpenAPI など、実装側が参照する machine-readable な契約も必要に応じて保管 -- **公開前 hygiene を重視** — ローカル絶対パス、個人情報、秘密情報、AI transcript 痕跡を監査する script と CI を用意 - **ポートフォリオ向けの短い説明構成** — README は参照実装リポジトリと同じ流れで、初見でも役割が分かる構成に統一 --- @@ -53,13 +52,7 @@ Some specifications in this repository describe FICTIONAL drug, disease, and cli ## 開発 -このリポジトリは仕様書中心のため、アプリケーションの build step はありません。公開前のローカル確認は次を実行します。 - -```bash -scripts/public-readiness-check.sh -gitleaks detect --source . --redact --no-banner -git diff --check -``` +このリポジトリは仕様書中心のため、アプリケーションの build step はありません。 JSON を変更した場合は、対象ファイルを parser で確認してください。 @@ -79,15 +72,6 @@ python3 -m json.tool fictional-drug-and-disease-ref/openapi.json >/dev/null --- -## セキュリティ / 公開前確認 - -- Git author / committer email は GitHub noreply に統一しています。 -- tracked tree、Git 履歴、GitHub Issue / Pull Request / コメントに対して、秘密情報・ローカル絶対パス・個人メールの混入を確認します。 -- README 用画像はリポジトリ内の `assets/readme/` に配置し、外部の一時 URL やローカルパスには依存しません。 -- 公開後は GitHub secret scanning / push protection / Dependabot security updates の有効化状態を確認します。 - ---- - ## ライセンス 本プロジェクトは [MIT License](./LICENSE) で公開しています。 diff --git a/scripts/public-readiness-check.sh b/scripts/public-readiness-check.sh index 55195ff..cc4d35a 100755 --- a/scripts/public-readiness-check.sh +++ b/scripts/public-readiness-check.sh @@ -8,12 +8,32 @@ check_absent() { local pattern="$2" shift 2 - if rg -n -I --hidden --glob '!.git/**' --glob '!scripts/public-readiness-check.sh' "$pattern" "$@"; then + if command -v rg >/dev/null 2>&1; then + if rg -n -I --hidden --glob '!.git/**' --glob '!scripts/public-readiness-check.sh' "$pattern" "$@"; then + echo "public-readiness-check: found ${label}" >&2 + failures=$((failures + 1)) + fi + return + fi + + if grep -R -E -n -I --exclude-dir=.git --exclude=public-readiness-check.sh "$pattern" "$@"; then echo "public-readiness-check: found ${label}" >&2 failures=$((failures + 1)) fi } +contains_fixed_string() { + local pattern="$1" + local file="$2" + + if command -v rg >/dev/null 2>&1; then + rg -q --fixed-strings "$pattern" "$file" + return + fi + + grep -F -q "$pattern" "$file" +} + mac_users='/(Us''ers|home)/[A-Za-z0-9_.-]+' win_users='[A-Z]:\\Us''ers\\[A-Za-z0-9_.-]+' local_path_pattern="${mac_users}|${win_users}" @@ -58,13 +78,13 @@ required_readme_sections=( '## 主な特徴' '## 仕様の置き場所' '## 現在の関連リポジトリ' + '## 開発' '## リポジトリ運用' - '## セキュリティ / 公開前確認' '## ライセンス' ) for section in "${required_readme_sections[@]}"; do - if ! rg -q --fixed-strings "$section" README.md; then + if ! contains_fixed_string "$section" README.md; then echo "public-readiness-check: README is missing section: $section" >&2 failures=$((failures + 1)) fi