A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
docs(oss): describe only live settings, two-stage untrusted-PR profile, private conduct contact, doc fixes
eyalgolanc54bea66af51
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERSindex c162a9f25..975975b18 100644--- a/.github/CODEOWNERS+++ b/.github/CODEOWNERS@@ -1,3 +1,2 @@-# Every pull request needs the maintainer's approval. the `main-review` ruleset requires a code-owner review, and this-# file makes the maintainer the owner of every path, so another collaborator's approval does not satisfy it.+# This file makes the maintainer the code owner of every path, so a change under .github/ is the maintainer's to review.* @eyalgolandiff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.ymlindex 78fb33d15..c47f6191a 100644--- a/.github/ISSUE_TEMPLATE/config.yml+++ b/.github/ISSUE_TEMPLATE/config.yml@@ -1,5 +1,8 @@blank_issues_enabled: falsecontact_links:- - name: Security vulnerability or conduct report+ - name: Security vulnerabilityurl: https://github.com/eyalgolan/statecraft-israel/security/advisories/new- about: Report privately. For a conduct report, start the title with "Conduct:". Do not open a public issue.+ about: Report privately. Do not open a public issue.+ - name: Conduct report+ url: https://github.com/eyalgolan+ about: Email the maintainer privately, using the email on the maintainer's GitHub profile. Do not open a public issue.diff --git a/.github/ISSUE_TEMPLATE/historical_accuracy.yml b/.github/ISSUE_TEMPLATE/historical_accuracy.ymlindex 5dbd47710..6a1726f13 100644--- a/.github/ISSUE_TEMPLATE/historical_accuracy.yml+++ b/.github/ISSUE_TEMPLATE/historical_accuracy.yml@@ -5,7 +5,7 @@ body:- type: markdownattributes:value: |- Read docs/CONTENT_POLICY.md first. Facts are open to correction with sources. The game's Israeli perspective is a+ Read https://github.com/eyalgolan/statecraft-israel/blob/main/docs/CONTENT_POLICY.md first. Facts are open to correction with sources. The game's Israeli perspective is astated design decision and is not changed through issues (section 1).- type: inputid: wherediff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.mdindex 2f9ddeb34..79561a6f1 100644--- a/CODE_OF_CONDUCT.md+++ b/CODE_OF_CONDUCT.md@@ -36,7 +36,7 @@ This Code of Conduct applies within all community spaces, and also applies when## Enforcement-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement privately, through this repository's Security tab: choose "Report a vulnerability" and start the title with "Conduct:" (https://github.com/eyalgolan/statecraft-israel/security/advisories/new). Only the maintainers can read it. All complaints will be reviewed and investigated promptly and fairly.+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement privately to the maintainer, by email, using the email on the maintainer's GitHub profile (https://github.com/eyalgolan). Do not use the vulnerability-reporting form for conduct reports. All complaints will be reviewed and investigated promptly and fairly.All community leaders are obligated to respect the privacy and security of the reporter of any incident.@@ -68,6 +68,20 @@ Community leaders will follow these Community Impact Guidelines in determining t**Consequence**: A permanent ban from any sort of public interaction within the community.+## Historical content and political discussion++This project depicts the history of Israel, including its wars, with real people and an Israeli perspective (see+[docs/CONTENT_POLICY.md](docs/CONTENT_POLICY.md)). People who take part will disagree about that history. In every project space:++- Discuss sources, not people. Argue with evidence, and link to it.+- Personal or political attacks on anyone, including on public figures as people, are unacceptable, and so are slurs,+ dehumanising language, denial or celebration of atrocities, and calls for violence against any group.+- The game's perspective is a stated design decision. Repeatedly re-opening it, in issues, pull requests or reviews,+ after the maintainer has pointed to [docs/CONTENT_POLICY.md](docs/CONTENT_POLICY.md) is disruptive conduct.+- Fact disputes follow [docs/CONTENT_POLICY.md](docs/CONTENT_POLICY.md) section 3. The maintainer's decision closes a dispute; a new source+ re-opens it.+- Moderators may lock threads that have turned into political argument, and will say why.+## AttributionThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].@@ -81,17 +95,3 @@ For answers to common questions about this code of conduct, see the FAQ at [http[Mozilla CoC]: https://github.com/mozilla/diversity[FAQ]: https://www.contributor-covenant.org/faq[translations]: https://www.contributor-covenant.org/translations--## Historical content and political discussion--This project depicts the history of Israel, including its wars, with real people and an Israeli perspective (see-`docs/CONTENT_POLICY.md`). People who take part will disagree about that history. In every project space:--- Discuss sources, not people. Argue with evidence, and link to it.-- Personal or political attacks on anyone, including on public figures as people, are unacceptable, and so are slurs,- dehumanising language, denial or celebration of atrocities, and calls for violence against any group.-- The game's perspective is a stated design decision. Repeatedly re-opening it, in issues, pull requests or reviews,- after the maintainer has pointed to `docs/CONTENT_POLICY.md` is disruptive conduct.-- Fact disputes follow `docs/CONTENT_POLICY.md` section 3. The maintainer's decision closes a dispute; a new source- re-opens it.-- Moderators may lock threads that have turned into political argument, and will say why.diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex effd42498..49977d2c8 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -39,7 +39,7 @@ Follow [docs/dev-setup.md](docs/dev-setup.md). In short:- the tools tests (they need the .NET SDK too: one runs the sim's release gate):`uv run --with pytest==9.1.1 --with rasterio==1.5.2 --with numpy==2.5.3 --with pyyaml==6.0.3 --with pillow==12.3.0 --with requests==2.32.5 pytest tools/tests -q`;- the repository policy checks:- `uv run --with pytest==9.1.1 --with pyyaml==6.0.3 --with requests==2.32.5 pytest scripts/oss/tests -q` and `uv run scripts/oss/check_repo.py`;+ `uv run --with pytest==9.1.1 --with pyyaml==6.0.3 --with requests==2.32.5 pytest scripts/oss/tests -q` and `uv run scripts/oss/check_repo.py --only secrets,emails,home-paths,sizes,symlinks` (the command CI runs);- Unity EditMode tests, if you touched `unity/` (`-buildTarget OSXUniversal` keeps an earlier WebGL build from leaving the editor on the wrong platform):`"$UNITY" -batchmode -projectPath unity -buildTarget OSXUniversal -runTests -testPlatform EditMode -testResults "$PWD/unity-editmode.xml" -logFile unity-tests.log`. There must be 0 `warning CS` in the log.4. **Text the player sees** has no internal ids, gives dates as "15 May 1948", and shows money as "IL 1.2m" or "$1.2m". The tests enforce this.@@ -62,7 +62,7 @@ AI-assisted work is welcome. Say so in the pull request: which parts, and how yo- Base your branch on `main`. History on `main` is protected, so no force-pushes.- In the description, say what changed and why. Paste the test commands you ran and their output; a description of the output doesn't count.-- The maintainer reviews every PR (`.github/CODEOWNERS`); a push after approval needs a fresh approval. PRs are squash-merged and keep you as the author.+- The maintainer reviews every PR (`.github/CODEOWNERS`).## What CI runsdiff --git a/SECURITY.md b/SECURITY.mdindex 9c803d3da..1d3f122e1 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -13,6 +13,9 @@ Do not open a public issue for a security problem. Use GitHub's private vulnerabPlease include what the issue is and what an attacker gets from it, the steps to reproduce, the commit SHA youtested, and your OS and browser (for the WebGL build) or Unity and .NET versions.+Conduct reports are not security reports: send them privately to the maintainer by email, using the+email on the maintainer's GitHub profile (see CODE_OF_CONDUCT.md), not through this form.+## What to expectAcknowledgement within 5 business days, and an assessment with a rough fix timeline within 15. This is a@@ -38,6 +41,6 @@ Out of scope:## Credentials-This repository holds no credentials and never should. Tools that need one (for example `promo/gen.py`) read it from an-environment variable. If you find one in this repository or its history, report it privately as above. It will be+This repository holds no credentials and never should. A tool that needs one must read it from an environment+variable, never from a file in the repository. If you find one in this repository or its history, report it privately as above. It will berevoked at its provider; history is not rewritten.diff --git a/docs/UNTRUSTED_PR_REVIEW.md b/docs/UNTRUSTED_PR_REVIEW.mdindex 920b564a8..cd76740f7 100644--- a/docs/UNTRUSTED_PR_REVIEW.md+++ b/docs/UNTRUSTED_PR_REVIEW.md@@ -14,7 +14,7 @@ verdict.** CI runs the PR's code on GitHub's machines with a read-only token and**Any diff under `.github/` can make every required check green.** CI runs the workflow file from the pull requestitself, so a PR that edits `.github/workflows/ci.yml` can turn `Changelog`, `Repo policy` or any other check into a job-that always passes. Green checks on such a PR mean nothing; read the `.github/` diff first, and the CODEOWNERS review is+that always passes. Green checks on such a PR mean nothing; read the `.github/` diff first, and your own review isthe real gate.## The profile@@ -29,16 +29,28 @@ cd repo && git fetch origin pull/<PR#>/head:pr && git checkout prgit diff origin/main...pr --statgit diff origin/main...pr -- '*.csproj' 'sim/Directory.Build.props' 'unity/Assets/Editor/**' '.github/**' 'scripts/**' 'tools/**'-# 3. To run anything, run it in a container with no credentials and no network:-docker run --rm -it --network none --cap-drop ALL --security-opt no-new-privileges \- -v "$PWD":/work:ro -w /work mcr.microsoft.com/dotnet/sdk:10.0 bash+# 3. To run anything, use two containers. Stage 1 restores packages into a writable copy of the checkout: it has the+# network, and only the checkout (read-only) and a work folder. (A restore also runs MSBuild targets from the PR,+# which is why it too sees no credentials.)+mkdir -p "$HOME/sc-review/cache" # under $HOME: Docker Desktop and colima share $HOME, not /tmp+docker run --rm --user "$(id -u):$(id -g)" -e HOME=/tmp -e DOTNET_CLI_HOME=/tmp -e DOTNET_NOLOGO=1 \+ --cap-drop ALL --security-opt no-new-privileges -e NUGET_PACKAGES=/cache/nuget \+ -v "$HOME/sc-review/cache":/cache -v "$PWD":/src:ro -w /tmp mcr.microsoft.com/dotnet/sdk:10.0 \+ bash -c 'rm -rf /cache/work && cp -a /src /cache/work && cd /cache/work && dotnet restore sim/Statecraft.sln'++# Stage 2 runs the tests with NO network, as you (not root), on that writable copy (the checkout stays read-only):+docker run --rm --network none --user "$(id -u):$(id -g)" -e HOME=/tmp -e DOTNET_CLI_HOME=/tmp -e DOTNET_NOLOGO=1 \+ --cap-drop ALL --security-opt no-new-privileges -e NUGET_PACKAGES=/cache/nuget \+ -v "$HOME/sc-review/cache":/cache -w /cache/work mcr.microsoft.com/dotnet/sdk:10.0 \+ dotnet test sim/Statecraft.sln --no-restore```Rules:1. **No credential volumes.** The container gets the checkout only: no `~/.config/gh`, no `~/.claude`, no Unitylicence, no `.env` file.-2. **No network** (`--network none`). An injected payload's first move is usually to phone home.+2. **No network while the PR's code runs** (`--network none` in Stage 2; Stage 1 only restores). An injected payload's+ first move is usually to phone home. Run as your own user, never root: a root container also changes what the tests see.3. **AI review only on a throwaway credential.** If you ask an AI agent to review the PR, run it inside the containerwith a separate, low-limit key made for that review, never your own session. Treat its verdict as text you read,never as a command you run.diff --git a/docs/superpowers/plans/2026-10-11-statecraft-open-source.md b/docs/superpowers/plans/2026-10-11-statecraft-open-source.mdindex f885a3e4c..dcf566546 100644--- a/docs/superpowers/plans/2026-10-11-statecraft-open-source.md+++ b/docs/superpowers/plans/2026-10-11-statecraft-open-source.md@@ -3352,11 +3352,12 @@ Co-Authored-By: Claude Opus 5.5 <[email protected]>"### Task 13: Merge policy as a ruleset (applied only by the owner)**Files:**-- Create: `scripts/oss/github/ruleset-protect-main.json`, `scripts/oss/github/ruleset-main-review.json`, `scripts/oss/github/repo-settings.json`, `scripts/oss/github/labels.tsv`, `scripts/oss/apply_github_settings.sh`, `scripts/oss/tests/test_merge_policy.py`+- Create: `scripts/oss/github/ruleset-protect-main.json`, `scripts/oss/github/ruleset-main-review.json`, `scripts/oss/github/repo-settings.json`, `scripts/oss/github/actions-permissions.json`, `scripts/oss/github/actions-selected.json`, `scripts/oss/github/labels.tsv`, `scripts/oss/apply_github_settings.sh`, `scripts/oss/tests/test_merge_policy.py`**Interfaces:**- Consumes: the CI job names (Task 3); the live ruleset `protect-main` (read 2026-10-10: `non_fast_forward`, `deletion`, no bypass actors; always looked up by name).-- Produces: two rulesets, both looked up **by name** (review N2, N7). `protect-main` (the live one, kept) blocks force-push and deletion with **no bypass actors**, so nobody, the owner included, can rewrite public history. `main-review` (new) adds code-owner review, squash-only merging and the four required checks, and only it carries the admin bypass of D12. `apply_github_settings.sh OWNER/REPO` PUTs or POSTs both, patches repo settings, and creates labels. No classic branch protection.+- Produces: two rulesets, both looked up **by name** (review N2, N7). `protect-main` (the live one, kept) blocks force-push and deletion with **no bypass actors**, so nobody, the owner included, can rewrite public history. `main-review` (new) adds code-owner review, squash-only merging and the four required checks, and only it carries the admin bypass of D12. `apply_github_settings.sh OWNER/REPO` PUTs or POSTs both, patches repo settings, and creates labels. No classic branch protection. Fix round 1 (review I5): it also PUTs `actions-permissions.json` (`{"enabled": true, "allowed_actions": "selected", "sha_pinning_required": true}`) and `actions-selected.json` (`{"github_owned_allowed": false, "verified_allowed": false, "patterns_allowed": ["actions/*", "astral-sh/setup-uv@*"]}`), so only those actions run and every `uses:` must be a full SHA (`.github/dependabot.yml` keeps the pins current). Add to `test_merge_policy.py`: a test that `actions-permissions.json` has `sha_pinning_required` true and `allowed_actions` `selected`, and that the allow-list is exactly those two patterns. Add to `apply_github_settings.sh`, before the labels loop: `gh api -X PUT "repos/$repo/actions/permissions" --input "$here/github/actions-permissions.json" >/dev/null` and `gh api -X PUT "repos/$repo/actions/permissions/selected-actions" --input "$here/github/actions-selected.json" >/dev/null`.+- **Docs follow the live settings (fix round 1, review I2).** Until the owner applies `main-review`, CONTRIBUTING.md and `.github/CODEOWNERS` describe only what is live (`protect-main`, private vulnerability reporting). In Step 5, after the owner applies the settings, update both in the same change: CONTRIBUTING "Pull requests" gains "a push after approval needs a fresh approval; PRs are squash-merged and keep you as the author", and the CODEOWNERS comment gains "the `main-review` ruleset requires a code-owner review". A test for each sentence lands with that change, not before.- [ ] **Step 1: Write the failing test.** `scripts/oss/tests/test_merge_policy.py`:diff --git a/scripts/oss/tests/test_policies.py b/scripts/oss/tests/test_policies.pyindex 2c6620621..f11bb6182 100644--- a/scripts/oss/tests/test_policies.py+++ b/scripts/oss/tests/test_policies.py@@ -75,7 +75,8 @@ def test_content_policy_states_the_owner_rules_and_only_real_mechanisms():def test_code_of_conduct_has_a_private_contact_and_the_history_section():text = read("CODE_OF_CONDUCT.md")assert "[INSERT" not in text and "getnohuman" not in text- assert "Conduct:" in text and "security/advisories/new" in text+ # Fix round 1: conduct reports do not go through the security-advisory form (a report there becomes a draft advisory).+ assert "email on the maintainer's GitHub profile" in text and "security/advisories/new" not in textassert "## Historical content and political discussion" in textassert "Contributor Covenant" in text and "version 2.1" in text@@ -92,3 +93,46 @@ def test_content_policy_claims_no_mechanism_that_does_not_exist():for phrase in ("excluded from release builds", "share-alike sources are refused", "A separate verifier","any mismatch blocks the text", "marked AI-generated in `ASSETS.yaml`"):assert phrase not in text, phrase+++def test_conduct_reports_do_not_use_the_security_form_and_no_address_is_written():+ sec = read("SECURITY.md")+ assert "Conduct reports" in sec and "email on the maintainer's GitHub profile" in sec+ import yaml+ cfg = yaml.safe_load(read(".github/ISSUE_TEMPLATE/config.yml"))+ conduct = [c for c in cfg["contact_links"] if "onduct" in c["name"]]+ assert conduct and all("security/advisories" not in c["url"] for c in conduct)+ assert not any("security/advisories" in c["url"] for c in cfg["contact_links"] if "ulnerab" not in c["name"])+ assert "Conduct:" not in read(".github/ISSUE_TEMPLATE/config.yml")+++def test_docs_describe_only_what_is_live_today():+ # Review I2: main-review (code-owner review, squash-only) is not applied yet; Task 13 updates these when it is.+ c = read("CONTRIBUTING.md")+ assert "fresh approval" not in c and "squash-merged" not in c+ o = read(".github/CODEOWNERS")+ assert "main-review" not in o+++def test_contributing_uses_the_check_that_passes_today():+ # Review I6: the full check_repo run fails until Task 14; CI's own command is what a contributor can run.+ c = read("CONTRIBUTING.md")+ assert "uv run scripts/oss/check_repo.py --only secrets,emails,home-paths,sizes,symlinks" in c+++def test_untrusted_review_profile_restores_with_network_then_runs_without():+ # Review I3: --network none cannot restore packages, and a read-only root-owned mount cannot build.+ text = read("docs/UNTRUSTED_PR_REVIEW.md")+ assert "Stage 1" in text and "Stage 2" in text and '--user "$(id -u):$(id -g)"' in text+ assert "-e HOME=/tmp" in text and "cp -a /src /cache/work" in text and text.count("--network none") >= 1+ stage1 = text.split("Stage 1")[1].split("Stage 2")[0]+ assert "--network none" not in stage1+++def test_small_doc_fixes_from_review():+ assert "promo/gen.py" not in read("SECURITY.md") # M5: it reads a file today; Task 11 changes that+ coc = read("CODE_OF_CONDUCT.md")+ assert coc.index("## Historical content and political discussion") < coc.index("## Attribution") # M6+ assert "](docs/CONTENT_POLICY.md)" in coc+ form = read(".github/ISSUE_TEMPLATE/historical_accuracy.yml")+ assert "https://github.com/eyalgolan/statecraft-israel/blob/main/docs/CONTENT_POLICY.md" in form # M7