Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore(gstack): commit gbrain's pregate guards, sealed paths and ship policy for gstack 1.91.98

garrytan90feaab2949d
diff --git a/.gitignore b/.gitignore
index 02fcae7291..93d1222161 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,8 @@ bin/
*.bun-build
.gstack/*
!.gstack/redact-allowlist
+!.gstack/pregate.json
+!.gstack/ship-policy.json
supabase/.temp/
.claude/skills/
# admin/dist/ is the React SPA bundle. CLAUDE.md says it's committed for
diff --git a/.gstack/pregate.json b/.gstack/pregate.json
new file mode 100644
index 0000000000..8abfc4eba7
--- /dev/null
+++ b/.gstack/pregate.json
@@ -0,0 +1,76 @@
+{
+ "dependencies": {
+ "test/**/*.serial.test.ts": [
+ "test/scripts/serial-files.test.ts"
+ ],
+ "scripts/serial-files.tsv": [
+ "test/scripts/serial-files.test.ts"
+ ],
+ "src/cli.ts": [
+ "test/cli-goldens.test.ts"
+ ],
+ "src/commands/**": [
+ "test/cli-goldens.test.ts"
+ ],
+ "src/core/operations*.ts": [
+ "test/cli-goldens.test.ts"
+ ]
+ },
+ "guards": [
+ {
+ "id": "serial-manifest",
+ "when": [
+ "test/**/*.serial.test.ts",
+ "scripts/serial-files.tsv",
+ "scripts/run-serial-tests.sh"
+ ],
+ "command": "bun test test/scripts/serial-files.test.ts",
+ "fix": "add the serial file's row to scripts/serial-files.tsv"
+ },
+ {
+ "id": "cli-goldens",
+ "when": [
+ "src/cli.ts",
+ "src/cli/**",
+ "src/commands/**",
+ "src/core/operations*.ts",
+ "src/core/ops/**"
+ ],
+ "command": "bun test --timeout=60000 test/cli-goldens.test.ts test/cli-dispatch-phase.test.ts test/export-surface-golden.test.ts",
+ "fix": "bun run regen:all, then justify each changed golden in the PR body"
+ },
+ {
+ "id": "regen-check",
+ "when": [
+ "src/**",
+ "skills/**",
+ "templates/**",
+ "plugin/**"
+ ],
+ "command": "bun scripts/regen-all.ts --check",
+ "fix": "bun run regen:all and commit the regenerated files"
+ },
+ {
+ "id": "migration-order",
+ "when": [
+ "src/core/schema-migrations/**"
+ ],
+ "command": "bun scripts/check-schema-migration-order.ts",
+ "fix": "renumber the migration to the next free number on master"
+ }
+ ],
+ "sealed": {
+ "paths": [
+ "eval/reports/**",
+ "**/sealed-confirmation/**",
+ "**/hard-sealed/**",
+ "**/counted/**"
+ ],
+ "transcripts": [
+ "**/results.jsonl",
+ "**/results.jsonl.gz",
+ "**/usage.jsonl.gz"
+ ],
+ "visibility": "public"
+ }
+}
diff --git a/.gstack/ship-policy.json b/.gstack/ship-policy.json
new file mode 100644
index 0000000000..2bc08f52f7
--- /dev/null
+++ b/.gstack/ship-policy.json
@@ -0,0 +1,21 @@
+{
+ "bump": "patch",
+ "queue_mode": "stamp-at-merge",
+ "changelog": "CHANGELOG.md",
+ "stamp_files": [
+ "VERSION", "package.json", "CHANGELOG.md", "openclaw.plugin.json",
+ ".claude-plugin/plugin.json", ".codex-plugin/plugin.json",
+ "plugin-variants/*/.claude-plugin/plugin.json", "plugin-variants/*/.codex-plugin/plugin.json",
+ "plugin-variants/*/README.md", "plugin/README.md",
+ "BOOTSTRAP_FOR_AGENTS.md", "templates/bootstrap/template-repo/README.md",
+ "src/core/behavior-change-notice.ts"
+ ],
+ "stamp_patterns": [
+ "\"version\": \"{version}\"",
+ "since: '{version}'",
+ "<!-- gbrain-plugin-tree-stamp: {version} -->",
+ "<!-- gbrain-template-stamp: {version} -->",
+ "<!-- gbrain-runbook-stamp: {version} -->"
+ ],
+ "migrations": { "dir": "src/core/schema-migrations", "id": "^v(\\d+)-" }
+}
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6f3fc464cf..4350adda3e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -704,6 +704,23 @@ Community PRs are batched into release waves rather than merged one-by-one;
contributor attribution stays attached via `Co-Authored-By:` trailers and every
accepted contribution is credited in `CHANGELOG.md`.
+### gstack repo config (`.gstack/`)
+
+Two committed files tell gstack (1.91.98.0 or later) about gbrain's own gates;
+gstack reads both from master, so a branch's edits take effect after it merges.
+
+- `.gstack/pregate.json`: `gstack-pregate run --allow-repo-commands` runs a
+ guard when the branch touches its files: the serial-lane manifest test, the
+ CLI goldens, `regen:all --check` and the schema-migration order check. A
+ failing guard prints its fix line. `sealed` lists eval output that must never
+ reach this public repository (run reports, sealed-confirmation and counted
+ cell outputs, per-cell `results.jsonl`/`usage.jsonl.gz`);
+ `gstack-pregate sealed` refuses a push that adds one.
+- `.gstack/ship-policy.json`: the stamp rule (the release stamp files and
+ version patterns) and the migration numbering `gstack-pregate regate` and
+ `gstack-tree-receipt` use to decide whether a restamped head is the same tree
+ that passed the gate.
+
### How a contributor PR lands
Contributor PRs are never merged into master as-is. A maintainer folds the