Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
831b1b0
chore(registry): refresh three stale source_hash lines
hyperpolymath Sep 15, 2026
f5bf21e
ci: zero-cost quality, security, coverage and mirroring pipeline
hyperpolymath Sep 21, 2026
66d7e1e
chore(hooks): wire gitleaks and lint/format validators into pre-commit
hyperpolymath Sep 21, 2026
dfda74d
ci(governance): retire Deno and unify the actions-lock gate
hyperpolymath Sep 21, 2026
d42256d
ci(deno): ban Deno and ledger the estate's measured debt
hyperpolymath Sep 21, 2026
711d4e2
ci(deno): replace the Deno lint job with a ledgered refusal
hyperpolymath Sep 21, 2026
8852c64
fix(hooks): per-ref pin check, syntax-aware SPDX
hyperpolymath Sep 22, 2026
b2383dd
docs(deno): correct canonical .gitignore ordering; fix Nickel gate
hyperpolymath Sep 22, 2026
0391275
docs(deno): fix the RSR seed spec — it banned Bun, allowed Deno
hyperpolymath Sep 22, 2026
bc940cb
docs(deno): match root CLAUDE.md's Bun row wording
hyperpolymath Sep 22, 2026
0cca048
fix(rsr): unfreeze language-policy twin to v2.0.0
hyperpolymath Sep 22, 2026
f374f8d
docs(rsr): rewrite seed CLAUDE.md against all four language bans
hyperpolymath Sep 22, 2026
ccc07cb
Update .githooks/validate-gitleaks.sh
hyperpolymath Sep 22, 2026
1915382
fix(ci): close vacuous SAST gate and bind mirror push to verified SHA
hyperpolymath Sep 22, 2026
6d5400c
fix(hooks): restore gitleaks call, drop invalid $/ pin arm (#899)
hyperpolymath Sep 22, 2026
339ed5a
chore(registry): regenerate after rebase (RSR seed source_hash)
hyperpolymath Sep 22, 2026
0f904e1
fix(review): address the 7 unresolved #899 threads (spdx scm+expressi…
hyperpolymath Sep 22, 2026
3216933
fix(ci): harden ci-pipeline downloads and bun installs (#899)
hyperpolymath Sep 22, 2026
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
4 changes: 2 additions & 2 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ for the canonical statement.
| TypeScript | AffineScript | RS/TS/JS → AffineScript → typed-wasm. |
| ReScript | AffineScript | RS/TS/JS → AffineScript → typed-wasm. |
| **ReScript** | AffineScript | Banned in new code as of 2026-04-30. Existing `.res` files migrate to `.affine` directly (do not pass through ReScript). |
| **Deno** | Bun | **Being removed.** Owner ruling 2026-08-26: *"deno is to go and bun is the way we are going, put it first everywhere unless not possible and explain why if not."* Existing Deno projects must migrate to Bun; where Bun genuinely cannot be used, the reason must be documented in the repo. Assessment of all 30 remaining `deno.json` locations: #658. |
| **Deno** | Bun | **Banned 2026-09-22.** Owner ruling: *"deno is over, we're prioritising bun, and using bunx."* `deno.json` task definitions must be ported to `package.json` scripts. Shrink-only ledger: `.machine_readable/deno-allow.txt`. |
| Node.js | Bun | Bun is Node-compatible; run the code, drop the runtime. |
| npm | Bun | npm is tier 4 — *permitted, never preferred*, not banned. `package-lock.json` must still not be tracked (standards#67). |
| npm | Bun | npm is tier 3 — *permitted, never preferred*, not banned. `package-lock.json` must still not be tracked (standards#67). |
| yarn | Bun | yarn is not in the tier list at all. |
| Go | Rust/SPARK | |
| **Python** | AffineScript/Rust/SPARK/Julia | Fully banned, no exceptions (SaltStack exception removed 2026-01-03) |
Expand Down
36 changes: 36 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,46 @@ run_validator() {
return 0
}

# run_validator (above) is FAIL-OPEN by design: a missing validator script
# warns and returns 0. That is tolerable for advisory checks and intolerable
# for a secrets gate, where "the validator is absent" and "no secrets found"
# produce exactly the same silence. This sibling fails CLOSED.
run_validator_required() {
local label="$1" script="$2" scope="$3"
local target_files=""
[ "$scope" = "staged" ] && target_files=$(git diff --cached --name-only --diff-filter=ACM 2>/dev/null || true)
[ -z "$target_files" ] && [ "$scope" = "staged" ] && return 0
if [ ! -f "$HOOK_DIR/$script" ]; then
echo -e "${RED}[pre-commit] ($label) REQUIRED validator '$script' is missing — refusing to pass a check that does not exist.${NC}" >&2
echo " Restore it from https://github.com/hyperpolymath/standards/tree/main/.githooks" >&2
ERRORS=$((ERRORS + 1))
return 1
fi
if [ ! -x "$HOOK_DIR/$script" ]; then
# A hook committed 0644 passes every local run that invokes it via `bash`
# and dies in CI at exit 126. Catch the mode here, where it is cheap.
echo -e "${YELLOW}[pre-commit] ($label) '$script' is not executable (mode should be 100755); running via bash anyway.${NC}" >&2
fi
echo -e "${BLUE}[pre-commit]${NC} Running ${label}..."
if ! INPUT_PATH="$REPO_ROOT" INPUT_STAGED_FILES="$target_files" bash "$HOOK_DIR/$script"; then
ERRORS=$((ERRORS + 1))
return 1
fi
return 0
}

echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE}Hyperpolymath Pre-commit Checks${NC}"
echo -e "${BLUE}========================================${NC}"

# Secrets first: it is the cheapest check that prevents the most expensive
# mistake, and a leaked credential is unrecoverable once pushed.
run_validator_required "Staged secret scan (gitleaks)" "validate-gitleaks.sh" "staged"

# Ecosystem-scoped lint + format. Read-only; confined to the ecosystems this
# repo actually has staged.
run_validator_required "Ecosystem lint + format" "validate-lint-format.sh" "staged"

# Language Policy
default_validator '\.(ts|tsx)$' "TypeScript files not allowed. Use AffineScript instead."
default_validator '\.go$' "Go files not allowed. Use Rust instead."
Expand Down
83 changes: 83 additions & 0 deletions .githooks/validate-gitleaks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: MPL-2.0
# Hyperpolymath Estate — staged-secret scan (pre-commit)
# Source: https://github.com/hyperpolymath/standards
#
# Scans ONLY what is staged, so it runs in the time a commit can afford.
#
# FAILS CLOSED. If gitleaks is not installed this exits non-zero and prints the
# install line. It never returns 0 on "could not scan": "validator absent" and
# "no secrets found" produce exactly the same silence, and a gate that reports
# success having examined nothing is worse than no gate at all — it is a gate
# somebody trusts.
#
# --redact is NOT optional. --verbose without it prints the discovered secret
# to the terminal and into scrollback, CI logs and any `script`/tmux capture,
# which turns a near-miss into a second disclosure.

set -euo pipefail

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'

REPO_ROOT="${INPUT_PATH:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
cd "$REPO_ROOT"

# Print the denominator. A scan whose input size is never shown cannot be
# told apart from a scan of nothing.
STAGED_COUNT="$(git diff --cached --name-only --diff-filter=ACM 2>/dev/null | grep -c . || true)"
echo "[gitleaks] staged files in scope: ${STAGED_COUNT}"

if [ "${STAGED_COUNT}" -eq 0 ]; then

Check failure on line 33 in .githooks/validate-gitleaks.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use '[[' instead of '[' for conditional tests. The '[[' construct is safer and more feature-rich.

See more on https://sonarcloud.io/project/issues?id=hyperpolymath_standards&issues=AaDIQXm7eASKwG8y_u0h&open=AaDIQXm7eASKwG8y_u0h&pullRequest=899
echo -e "${YELLOW}[gitleaks] nothing staged; no scan performed (this is not a pass).${NC}"
exit 0
fi

if ! command -v gitleaks >/dev/null 2>&1; then
echo -e "${RED}[gitleaks] gitleaks is NOT installed — refusing to let a commit through unscanned.${NC}" >&2
echo "" >&2
echo " Install one of:" >&2
echo " brew install gitleaks" >&2
echo " go install github.com/zricethezav/gitleaks/v8@latest" >&2
echo " https://github.com/gitleaks/gitleaks/releases (pinned binary, verify sha256)" >&2
echo "" >&2
echo " Deliberate override for this one commit: git commit --no-verify" >&2
exit 1
fi

# Gitleaks moved staged scanning between major versions: 8.x exposes
# `protect --staged`, and newer releases expose `git --staged` while hiding
# `protect`. PROBE for the subcommand instead of assuming either one.
#
# ⚠ Do not hard-code `gitleaks git` here. MEASURED 2026-09-22 on the installed
# binary, whose subcommands are exactly: completion, detect, help, protect,
# version. `gitleaks git` exits 1 as an unknown command — and because the
# failure branch below treats ANY non-zero exit as a finding, that reports
# "SECRET DETECTED" and refuses every commit while having scanned NOTHING.
# A gate that has scanned nothing must never be able to look like either a
# pass or a finding.
if gitleaks git --help >/dev/null 2>&1; then
GITLEAKS_STAGED=(gitleaks git --staged --verbose --redact)
elif gitleaks protect --help >/dev/null 2>&1; then
GITLEAKS_STAGED=(gitleaks protect --staged --verbose --redact)
else
echo -e "${RED}[gitleaks] installed gitleaks exposes neither 'git --staged' nor" >&2
echo -e " 'protect --staged'. Refusing to report a pass from a scan that cannot run.${NC}" >&2
exit 1
fi

if "${GITLEAKS_STAGED[@]}"; then
echo -e "${GREEN}[gitleaks] no secrets detected in ${STAGED_COUNT} staged file(s).${NC}"
exit 0
fi

echo "" >&2
echo -e "${RED}[gitleaks] SECRET DETECTED in staged changes — commit refused.${NC}" >&2
echo " Values above are redacted; the rule id and location are not." >&2
echo "" >&2
echo " If this is a real credential: rotate it FIRST, then unstage." >&2
echo " If it is a false positive: add a scoped allow rule to .gitleaks.toml," >&2
echo " or append the fingerprint to .gitleaksignore — never a blanket skip." >&2
exit 1
Loading
Loading