Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
ci(pregate): map /ship's unit, serial, slow and E2E lanes to full-ci runs (ship_lanes_from)
garrytan7b1a2a5a64da
diff --git a/.gstack/pregate.json b/.gstack/pregate.jsonindex 4daaf541b8..be0fa50723 100644--- a/.gstack/pregate.json+++ b/.gstack/pregate.json@@ -164,6 +164,24 @@"profiles": ["test", "e2e"],"inventory": "bash scripts/pregate-remote-gate.sh --list"},+ "ship_lanes_from": {+ "bun run test": {+ "profiles": ["test"],+ "inventory": "GBRAIN_PREGATE_GATE_CMD='bun run ci:ubicloud' bash scripts/pregate-remote-gate.sh --list --lanes unit,serial"+ },+ "bun run test:serial": {+ "profiles": ["test"],+ "inventory": "GBRAIN_PREGATE_GATE_CMD='bun run ci:ubicloud' bash scripts/pregate-remote-gate.sh --list --lanes serial"+ },+ "bun run test:slow": {+ "profiles": ["test"],+ "inventory": "GBRAIN_PREGATE_GATE_CMD='bun run ci:ubicloud' bash scripts/pregate-remote-gate.sh --list --lanes slow"+ },+ "bun run test:e2e": {+ "profiles": ["test", "e2e"],+ "inventory": "GBRAIN_PREGATE_GATE_CMD='bun run ci:ubicloud' bash scripts/pregate-remote-gate.sh --list --lanes e2e"+ }+ },"allowlist": [{"finding": "pii.phone.e164",diff --git a/.gstack/ship-policy.json b/.gstack/ship-policy.jsonindex 0786e37a40..ec3b653e9a 100644--- a/.gstack/ship-policy.json+++ b/.gstack/ship-policy.json@@ -1,6 +1,6 @@{"bump": "patch",- "min_gstack_version": "1.91.377.0",+ "min_gstack_version": "1.94.4.0","queue_mode": "stamp-at-merge","changelog": "CHANGELOG.md","stamp_files": [diff --git a/AGENTS.md b/AGENTS.mdindex fbd773d64b..0bea50cb84 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -346,7 +346,8 @@ integrator runs the full gate.Manual path: `bun test` plus the E2E lifecycle described in `./CLAUDE.md` (spinup the test Postgres container, run `bun run test:e2e`, tear it down).-Ship via the `/ship` skill, not by hand. The full release + contributor process+Ship via the `/ship` skill, not by hand. Pass its test lanes the exact commands in+[/ship lanes](docs/ci-event-parity.md#ship-lanes), so a passed full-ci run carries them. The full release + contributor process(CHANGELOG voice, version-locations sync, PR conventions, community-PR-wave) lives in[`./docs/RELEASING.md`](./docs/RELEASING.md); read it before shipping.diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 0af8edd8e6..5211dba08d 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -706,7 +706,7 @@ accepted contribution is credited in `CHANGELOG.md`.### gstack repo config (`.gstack/`)-Two committed files tell gstack (1.91.377.0 or later) about gbrain's own gates;+Two committed files tell gstack (1.94.4.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@@ -729,11 +729,14 @@ gstack reads both from master, so a branch's edits take effect after it merges.--run <E2E run>` clear that obligation from a slot's passed full-ci runs ofthe same tree, checked against the inventory `bash scripts/pregate-remote-gate.sh--list` prints ([run evidence](docs/ci-event-parity.md#run-evidence-for-gstack-gstack-pregate-clear---run)).+ `ship_lanes_from` maps /ship's unit, serial, slow and E2E lane commands to+ those runs, so /ship carries a lane from full-ci instead of running it again+ ([/ship lanes](docs/ci-event-parity.md#ship-lanes)).- `.gstack/ship-policy.json`: the stamp rule (the release stamp files andversion 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, plus `min_gstack_version` (1.91.377.0, the first gstack- that reads `run_profiles`; an older one refuses with an upgrade fix).+ that passed the gate, plus `min_gstack_version` (1.94.4.0; 1.94.0.0 is the first gstack that+ reads `ship_lanes_from`; an older one refuses with an upgrade fix).### How a contributor PR landsdiff --git a/docs/ci-event-parity.md b/docs/ci-event-parity.mdindex 9c31aeb8c1..09b378b22d 100644--- a/docs/ci-event-parity.md+++ b/docs/ci-event-parity.md@@ -183,6 +183,47 @@ inventory:only from `origin/<base>`, so a branch cannot loosen them. gstack acceptsthese keys from 1.91.377.0 on.+<a id="ship-lanes"></a>+### /ship lanes and CI carry++CI's full run is the one full test run. gstack 1.94.0.0 and newer carry a /ship+test lane from a passed full-ci run at the exact, clean tree instead of running+it again (`LANE: <label> carried run=<id>/<attempt> tests_ran=<n>`), through+`ship_lanes_from` in `.gstack/pregate.json`. gstack matches the lane's command+byte for byte, so pass these commands to /ship as `--lane <label>=<command>`+exactly as written:++| Lane | Exact command | Run profiles | Inventory lanes |+|---|---|---|---|+| `unit` | `bun run test` | `test` | `unit,serial` |+| `serial` | `bun run test:serial` | `test` | `serial` |+| `slow` | `bun run test:slow` | `test` | `slow` |+| `e2e` | `bun run test:e2e` | `test`, `e2e` | `e2e` |++A lane carries only when every one of these holds:++- The newest Test (`full-suite`) run at HEAD passed, and for `e2e` the newest+ E2E (`e2e-full-suite`) run too (Test is named because the reconciliation+ job runs two `test/e2e/` files). gstack refuses a newer red or running run on+ HEAD, a run older than 24 hours, and a working tree that is not HEAD's+ committed tree.+- Every file the lane runs is in the runs' `tree.json`. The inventory is+ `GBRAIN_PREGATE_GATE_CMD='bun run ci:ubicloud' bash scripts/pregate-remote-gate.sh --list --lanes <lanes>`,+ the same lists the full Ubicloud gate runs. Like the remote gate's own+ inventory, it refuses (exit 1, no list) on a tree that changes the CI reuse+ files or the inventory builders, so such a tree's runs never carry its lanes+ ([remote-gate reuse](#remote-gate-reuse)).+- The `e2e` inventory leaves out `test/e2e/skills.test.ts`, which needs+ provider keys and openclaw. full-ci runs neither, so the file never runs+ there. Run it by name when your change touches it.++`bun run verify` and `bun run typecheck` don't carry: `tree.json` records test+files only, so no inventory can show that CI ran them. They take about a minute+locally. pregate's guards, secrets and sealed checks always run.++To check a lane before /ship does, at the pushed head:+`~/.claude/skills/gstack/bin/gstack-ci-carry find --base master --command 'bun run test' --allow-repo-commands`.+## Dependency-audit rule`dependency-audit` blocks on pushes, schedules, manual runs and pull requestsdiff --git a/llms-full.txt b/llms-full.txtindex be60d11d32..96b6426dfa 100644--- a/llms-full.txt+++ b/llms-full.txt@@ -2118,7 +2118,8 @@ integrator runs the full gate.Manual path: `bun test` plus the E2E lifecycle described in `./CLAUDE.md` (spinup the test Postgres container, run `bun run test:e2e`, tear it down).-Ship via the `/ship` skill, not by hand. The full release + contributor process+Ship via the `/ship` skill, not by hand. Pass its test lanes the exact commands in+[/ship lanes](docs/ci-event-parity.md#ship-lanes), so a passed full-ci run carries them. The full release + contributor process(CHANGELOG voice, version-locations sync, PR conventions, community-PR-wave) lives in[`./docs/RELEASING.md`](./docs/RELEASING.md); read it before shipping.diff --git a/scripts/structural-suites.tsv b/scripts/structural-suites.tsvindex a8a0ac3599..b0374109f7 100644--- a/scripts/structural-suites.tsv+++ b/scripts/structural-suites.tsv@@ -341,6 +341,11 @@ test/scripts/nightly-issue.test.ts nightly-watch routing and guard 9 readFileSyntest/scripts/nightly-issue.test.ts operator messages carry docs anchors that resolve 1 readFileSynctest/scripts/postgres-lane-coverage.test.ts check-postgres-lane-coverage.ts 9 readFileSynctest/scripts/postgres-unit-arms.test.ts postgres-unit-arms list 14 readFileSync+test/scripts/pregate-remote-gate.test.ts .gstack policy floor 1 readFileSync+test/scripts/pregate-remote-gate.test.ts pregate-remote-gate.sh 8 readFileSync+test/scripts/pregate-remote-gate.test.ts pregate-remote-gate.sh --list 4 readFileSync+test/scripts/pregate-remote-gate.test.ts reuse of GitHub full runs on the identical tree 9 readFileSync+test/scripts/pregate-remote-gate.test.ts ship_lanes_from (/ship lanes carried from CI, docs/ci-event-parity.md#ship-lanes) 3 readFileSynctest/scripts/promote-stable.test.ts promote-stable.yml 2 readFileSynctest/scripts/regen-all.test.ts regen:all 5 readFileSynctest/scripts/require-executed-tests.test.ts require-executed-tests 9 readFileSyncdiff --git a/test/scripts/pregate-remote-gate.test.ts b/test/scripts/pregate-remote-gate.test.tsindex cf702e1974..b043c2e595 100644--- a/test/scripts/pregate-remote-gate.test.ts+++ b/test/scripts/pregate-remote-gate.test.ts@@ -354,3 +354,36 @@ describe('.gstack policy floor', () => {expect(a * 1e8 + b * 1e4 + c).toBeGreaterThanOrEqual(1 * 1e8 + 91 * 1e4 + 377);});});++describe('ship_lanes_from (/ship lanes carried from CI, docs/ci-event-parity.md#ship-lanes)', () => {+ const root = join(import.meta.dir, '..', '..');+ const pregate = JSON.parse(readFileSync(join(root, '.gstack/pregate.json'), 'utf8'));+ const ship = JSON.parse(readFileSync(join(root, '.gstack/ship-policy.json'), 'utf8'));+ const lanes: Record<string, { profiles: string[]; inventory: string }> = pregate.ship_lanes_from ?? {};+ const doc = readFileSync(join(root, 'docs/ci-event-parity.md'), 'utf8');+ const start = doc.indexOf('<a id="ship-lanes"></a>');+ const body = start < 0 ? '' : doc.slice(doc.indexOf('\n', doc.indexOf('### ', start)));+ const section = body.slice(0, body.search(/\n#{1,6} /) >>> 0);+ const rows = [...section.matchAll(/^\| `([a-z0-9-]+)` \| `([^`]+)` \| ([^|]+) \| `([a-z0-9,-]+)` \|$/gm)]+ .map(([, label, command, profiles, gateLanes]) => ({ label, command, profiles: [...profiles.matchAll(/`([a-z0-9-]+)`/g)].map(m => m[1]), gateLanes }));++ it('maps exactly the documented lane commands, byte for byte, to the documented run profiles', () => {+ expect(rows.length).toBeGreaterThan(0);+ expect(Object.keys(lanes).sort()).toEqual(rows.map(r => r.command).sort());+ for (const r of rows) expect(lanes[r.command]!.profiles).toEqual(r.profiles);+ for (const m of Object.values(lanes)) for (const name of m.profiles) expect(Object.keys(pregate.run_profiles)).toContain(name);+ });++ it("lists each lane's files through the full gate's --list, so a tree that changes the CI reuse files never carries its own runs", () => {+ expect(rows.length).toBeGreaterThan(0);+ for (const r of rows) {+ expect(lanes[r.command]!.inventory).toBe(`GBRAIN_PREGATE_GATE_CMD='bun run ci:ubicloud' bash scripts/pregate-remote-gate.sh --list --lanes ${r.gateLanes}`);+ }+ });++ it('ship-policy.json declares min_gstack_version 1.94.0.0 or newer, the first gstack that reads ship_lanes_from', () => {+ expect(Object.keys(lanes).length).toBeGreaterThan(0);+ const [a, b, c] = String(ship.min_gstack_version ?? '').split('.').map(Number);+ expect(a * 1e8 + b * 1e4 + c).toBeGreaterThanOrEqual(1 * 1e8 + 94 * 1e4 + 0);+ });+});