fix(init-wiki): robust, owner-parametrised, token-aware wiki seeding#90
Merged
Conversation
The script is the estate work-around for GitHub having no API to create/seed a
wiki (the .wiki.git repo is created lazily on first UI save). Hardening:
- Fix WIKI_DIR quoting bug (""$HYPATIA_TMPDIR/...) -> mktemp -d + trap cleanup.
- Accept <owner>/<repo> (or $WIKI_OWNER); no longer hardcoded to hyperpolymath,
so it works for metadatastician/* etc.
- Enable the wiki first via `gh api -X PATCH repos/<slug> -F has_wiki=true` so
the push target actually exists.
- Token-aware remote: GH_TOKEN/GITHUB_TOKEN -> HTTPS x-access-token (CI / GitHub
App installation token); else SSH.
- Never clobber human-edited pages (write_page only creates missing files).
- On push failure, surface the real error and the lazy-init fallback (create the
first page once via UI / browser-automation agent, then re-run) instead of a
silent "Failed to push".
- set -euo pipefail; passes `bash -n` and `shellcheck -S warning`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
hyperpolymath
marked this pull request as ready for review
July 20, 2026 16:54
hyperpolymath
added a commit
to hyperpolymath/standards
that referenced
this pull request
Jul 20, 2026
…Hub App) (#509) ## What Adds `.github/actions/signed-push` — an estate composite action that pushes a branch's local commits as GitHub **Verified** commits, using a **GitHub App installation token** + `createCommitOnBranch` (via `Asana/push-signed-commits`). ## Why (Arm B1) Automation commits made with a PAT or `GITHUB_TOKEN` are **Unverified**. Any branch whose ruleset enforces `required_signatures` then **cannot merge** — this is exactly why **IDApTIK #28** is `BLOCKED` right now (all 4 commits `verified=false / unknown_key`). A GitHub App authoring commits via `createCommitOnBranch` produces Verified commits GitHub signs itself, satisfying the rule. The same App also unlocks `.github/workflows` edits (Workflows: write) and `delete_repo` (Administration: write), retiring several "GitHub API won't let AI tools operate" blockers at once. ## Details - SHA-pinned: `create-github-app-token` v3.2.0 (`bcd2ba4…`), `push-signed-commits` v1 (`6e073ae…`). - README documents the one-time App setup and the caveat that PR-only / merge-queue rules are **separate** from `required_signatures` — the App may need adding to those rulesets' **bypass list**. ## ⛔ Blocked / not yet verifiable Requires the org to **register the GitHub App** and set **`APP_ID`** + **`APP_PRIVATE_KEY`** secrets before it can run. Draft until then. YAML validated (parses as a valid composite action); not runnable in CI without the App. ## Related - Immediate estate-wide unblock for `required_signatures`: register the SSH **Signing Key** so existing commits flip to Verified. - Sibling work: `hyperpolymath/scripts#90` (wiki-seed adapter), and the community feature request for a wiki API. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Hardens
init-wiki.sh— the estate work-around for GitHub having no API to create/seed a wiki (the.wiki.gitrepo is created lazily on first UI save; see the open feature request being filed at community discussions).Why
The previous version had a
WIKI_DIRquoting bug, was hardcoded tohyperpolymath/, and — critically — never enabled the wiki, so the lazy-init case silently printed "Failed to push" with no guidance.Changes
WIKI_DIR=""$HYPATIA_TMPDIR/...quoting bug →mktemp -d+trapcleanup.<owner>/<repo>(or$WIKI_OWNER), so it works formetadatastician/*etc., not justhyperpolymath/*.gh api -X PATCH repos/<slug> -F has_wiki=trueso the push target exists.GH_TOKEN/GITHUB_TOKEN→ HTTPSx-access-token(CI / GitHub App installation token); else SSH.write_pageonly creates missing pages — never clobbers human-edited wiki content on re-run.set -euo pipefail.Verification
bash -n init-wiki.sh→ syntax OKshellcheck -S warning init-wiki.sh→ no warningsmetadatastician/paint-type+ bare-repo default) and no-clobber idempotency confirmed.Part of the "route around GitHub API limits for AI tooling" work (Arm B2). Draft pending live run against a repo with no existing wiki.
🤖 Generated with Claude Code