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
27 changes: 27 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
#
# pre-commit: block proprietary source from entering this public repo.
# Enable with: git config core.hooksPath .githooks
#
# Checks only the staged (added/copied/modified) files for speed.
# POSIX bash 3.2 compatible (stock macOS).
set -euo pipefail

repo_root="$(git rev-parse --show-toplevel)"
checker="$repo_root/scripts/check-proprietary-source.sh"

if [ ! -f "$checker" ]; then
echo "pre-commit: $checker is missing — refusing to commit without the guard." >&2
exit 1
fi

staged=()
while IFS= read -r f; do
[ -n "$f" ] && staged+=("$f")
done < <(git diff --cached --name-only --diff-filter=ACM)

if [ "${#staged[@]}" -eq 0 ]; then
exit 0
fi

bash "$checker" "${staged[@]}"
12 changes: 12 additions & 0 deletions .githooks/pre-merge-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
#
# pre-merge-commit: git does NOT run pre-commit for merge commits, so a
# `git merge` that brings in proprietary source would otherwise slip past the
# local guard entirely. This repo vendors third-party sources (unity-webview),
# which makes merging an upstream branch a routine operation — exactly the case
# that needs covering. Delegates to the same check as pre-commit.
#
# Enable with: git config core.hooksPath .githooks
set -euo pipefail

exec bash "$(git rev-parse --show-toplevel)/.githooks/pre-commit"
41 changes: 41 additions & 0 deletions .github/workflows/no-proprietary-source.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: No proprietary source

# Fail-closed gate: keeps native (Java/Kotlin) source, the private Gradle
# build system, and the private build pipeline out of this public repo.
# Native code ships only as compiled .aar / .unitypackage / .bundle artifacts.
# See scripts/check-proprietary-source.sh for the denylist and rationale.
#
# Runs on every push to ANY branch (the repo is public, so a pushed branch is
# world-visible even without a PR) and on every PR.

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: ['**']
Comment thread
marc-n-dream marked this conversation as resolved.

jobs:
no-proprietary-source:
runs-on: ubuntu-latest
Comment thread
marc-n-dream marked this conversation as resolved.
# Read-only gate: it only ever scans the tree, so it must not be able to
# write to it. Do not widen without a concrete reason.
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Scan tracked files for proprietary source
run: bash scripts/check-proprietary-source.sh
shell: bash

- name: Reject submodule gitlinks
run: |
gitlinks=$(git ls-files -s | awk '$1 == "160000" { print $4 }')
if [ -n "$gitlinks" ]; then
echo "ERROR: submodule gitlink(s) found — the private repos must not be" >&2
echo "referenced as submodules in this public repo:" >&2
echo "$gitlinks" | sed 's/^/ - /' >&2
exit 1
fi
shell: bash
64 changes: 16 additions & 48 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ obj/
ehthumbs.db
Thumbs.db

# ============ #
# Backup / merge artifacts (defense-in-depth: keep proprietary source that
# leaks into *.orig/*.bak/*~ from being staged by `git add -A`). The guard
# in scripts/check-proprietary-source.sh is the enforced backstop.
# ============ #
*.orig
*.rej
*.bak
*~

# ============ #
# Visual Studio Code generated #
# ============ #
Expand Down Expand Up @@ -77,51 +87,9 @@ ai-setup-backup-*.tar.gz
.serena/
.state/
.worktrees/

# framework-local state roots
.compound-engineering/*
!.compound-engineering/plans/
!.compound-engineering/plans/**
!.compound-engineering/brainstorms/
!.compound-engineering/brainstorms/**
!.compound-engineering/solutions/
!.compound-engineering/solutions/**
!.compound-engineering/knowledge/
!.compound-engineering/knowledge/**
!.compound-engineering/evidence/
!.compound-engineering/evidence/**
!.compound-engineering/specs/
!.compound-engineering/specs/**
!.compound-engineering/*.md
!.compound-engineering/*.example.yaml
.sisyphus/*
!.sisyphus/plans/
!.sisyphus/plans/**
!.sisyphus/brainstorms/
!.sisyphus/brainstorms/**
!.sisyphus/solutions/
!.sisyphus/solutions/**
!.sisyphus/knowledge/
!.sisyphus/knowledge/**
!.sisyphus/evidence/
!.sisyphus/evidence/**
!.sisyphus/specs/
!.sisyphus/specs/**
!.sisyphus/*.md
!.sisyphus/*.example.yaml
.planning/*
!.planning/plans/
!.planning/plans/**
!.planning/brainstorms/
!.planning/brainstorms/**
!.planning/solutions/
!.planning/solutions/**
!.planning/knowledge/
!.planning/knowledge/**
!.planning/evidence/
!.planning/evidence/**
!.planning/specs/
!.planning/specs/**
!.planning/*.md
!.planning/*.example.yaml
# END idream-managed agent workspace
.claude/worktrees/
.claude/*.local.json
.omc/
.compound-engineering/
.sisyphus/
.planning/
1 change: 0 additions & 1 deletion .serena/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .serena/memories/project_overview.md

This file was deleted.

4 changes: 0 additions & 4 deletions .serena/memories/style_and_conventions.md

This file was deleted.

6 changes: 0 additions & 6 deletions .serena/memories/suggested_commands.md

This file was deleted.

6 changes: 0 additions & 6 deletions .serena/memories/task_completion.md

This file was deleted.

133 changes: 0 additions & 133 deletions .serena/project.yml

This file was deleted.

9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ Unity build: run from Unity Editor or configured Unity batchmode build.
PostprocessBuild auto runs during Unity build.
Export package: use Unity export package workflow for `.unitypackage`.
Run tests: use Unity Test Runner for EditMode and PlayMode suites.
## PROPRIETARY-SOURCE GUARD
This repo is PUBLIC. AirConsole-authored native Android and webview source is PRIVATE and ships here only as compiled artifacts.
NEVER commit native source or the private build system: `*.java`, `*.kt`, Gradle files, `*.sh`/`Rakefile`/`*.rake` build scripts, `*.toml` version catalogs, `AndroidManifest.xml`, `src/main/res/`, `*.iml`/`.idea/` project files.
Only compiled artifacts (`.aar`, `.unitypackage`, `.bundle`) and glue (`.cs`, `.jslib`) belong here. The sole `.mm` exception is `Assets/AirConsole/unity-webview/Plugins/iOS/*.mm` — third-party upstream (GREE / Takahashi, zlib), public by licence. Never add AirConsole-authored native code as `.mm`.
`scripts/check-proprietary-source.sh` is the shared denylist check.
CI `.github/workflows/no-proprietary-source.yml` is the authoritative gate; it scans every push (any branch) and PR.
Enable the fast local pre-commit guard once per clone: `git config core.hooksPath .githooks`.
A path guard cannot see file contents: never paste native source into an accepted file (`.cs`, `.md`) either.

## FORBIDDEN
NEVER hardcode device IDs.
NO platform specific code outside `plugins/`.
Expand Down
Loading
Loading