mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-05 16:34:00 +01:00
docs(pregate): the user-owned policy file and local lanes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6fdec4c5a7
commit
47173fccfd
2 files changed
+20
-3
No files matched your search
+11
-1
@@ -63,6 +63,7 @@ the byte-pinned `/ship` renders in `test/fixtures/golden/`).
|
||||
| `selection` | `workflow.yml/job` → a command printing the lane's file list, for matrices a planner computes (gstack: `scripts/test-free-shards.ts --list`) |
|
||||
| `warn` | check ids downgraded to warn; `secrets` and required lanes never |
|
||||
| `strays.allow` | intentional root files or new top-level directories |
|
||||
| `local` | `workflow.yml/job` lanes a local run satisfies: a platform-agnostic toolchain (an `ubuntu-latest` suite that runs the same on a Mac), or a repo whose CI is off. Their tests run here instead of becoming `requires-remote` |
|
||||
| `guards` | `[{ id, when: [globs], command, fix?, timeout_s? }]`: repo commands a lane must pass when a touched file matches `when` (manifest checks, subprocess goldens the import graph cannot see); see [guards](#guards) |
|
||||
| `serial_patterns` | test-file globs the `lanes` check runs one process per file, apart from the unit files (default `**/*.serial.test.*`) |
|
||||
| `sealed` | sealed or eval output that must never reach a public destination; read by the pre-push hook and `gstack-pregate sealed` (see [sealed output](#sealed)) |
|
||||
@@ -71,7 +72,16 @@ the byte-pinned `/ship` renders in `test/fixtures/golden/`).
|
||||
| `remote_gate` | the repo's remote test gate command; under 8 cores the local test tier becomes a `requires-remote` obligation naming it, and `--remote` runs it (see [remote gate](#remote-gate)) |
|
||||
|
||||
Only the `origin/<base>` copy is honoured, so a downgrade is reviewed before it
|
||||
takes effect. `gstack-pregate validate` / `init` cover the working-tree file.
|
||||
takes effect. A repo that keeps `.gstack/` out of git (a shared repo where gstack
|
||||
is one contributor's tool) can hold the same file at
|
||||
`<GSTACK_HOME>/projects/<slug>/pregate.json`. It is read only when the base
|
||||
carries none (never under `--policy-from head`), it lives outside the repository
|
||||
so a PR still cannot reach it, and the record names it (`policy user <path>`).
|
||||
It covers `gstack-pregate run` only: `sealed` and `price_file` are read from the
|
||||
base branch's copy, so the user file refuses them (`PREGATE_CONFIG_INVALID`)
|
||||
rather than holding a policy nothing reads. A user file that exists but cannot
|
||||
be read refuses the same way instead of falling back to defaults.
|
||||
`gstack-pregate validate` / `init` cover the working-tree file.
|
||||
|
||||
## `gstack-pregate`
|
||||
|
||||
|
||||
@@ -2751,7 +2751,10 @@ or `REALITY: surface-check finding bun upgrade --version absent on 1.3.14 bin/gs
|
||||
|
||||
Both tools read their pin file (`.gstack/generated.json`, `.gstack/pregate.json`)
|
||||
from `origin/<base>`, never the working tree, and run repo-declared commands only
|
||||
under `--allow-repo-commands` or inside `/ship`. Details: docs/pregate.md.
|
||||
under `--allow-repo-commands` or inside `/ship`. When the base carries no
|
||||
`.gstack/pregate.json`, `gstack-pregate run` reads
|
||||
`<GSTACK_HOME>/projects/<slug>/pregate.json` instead (outside the repository).
|
||||
Details: docs/pregate.md.
|
||||
|
||||
<a id="regen-registry-invalid"></a>
|
||||
### `REGEN_REGISTRY_INVALID`
|
||||
@@ -2794,10 +2797,14 @@ reference the repository's (gstack's entries do through `bun run`).
|
||||
|
||||
**Meaning.** `.gstack/pregate.json` has an unknown key, a wrong type, a glob
|
||||
that escapes the repository, a runner without `{files}`, or `secrets` in `warn`.
|
||||
The user-owned `<GSTACK_HOME>/projects/<slug>/pregate.json` also refuses when it
|
||||
sets `sealed` or `price_file` (both are read only from the base branch's copy)
|
||||
or exists but cannot be read.
|
||||
|
||||
**Fix.** `gstack-pregate validate`. `secrets` and required-lane obligations
|
||||
cannot be downgraded; every other check id in `warn` is honoured only from the
|
||||
base branch's copy.
|
||||
base branch's copy. For the user-owned file, edit it directly at the path the
|
||||
message names.
|
||||
|
||||
<a id="pregate-secrets"></a>
|
||||
### `PREGATE_SECRETS`
|
||||
|
||||
Reference in new issue
Block a user