mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-23 08:31:44 +01:00
v1.92.75.0 stamp: merge main f865cd9fc7 into #3845 (land)
This commit is contained in:
commit
6423845978
83 files changed
+2866
-388
No files matched your search
+97
-13
@@ -195,7 +195,10 @@ Two stages with separate clocks, both printed:
|
||||
changed Python (`.py`, `.pyi`) or Dart file is scanned whole and only
|
||||
findings on its added lines count, so a line added inside an existing
|
||||
`"""` or `'''` string is still read as a literal; its rows give the file's
|
||||
line number (`app.py, line 10`).
|
||||
line number (`app.py, line 10`). A tracked file's whole text is the version
|
||||
git diffed (a full-context `git diff`), never the working copy; an untracked
|
||||
file is read whole from disk. A file over the size limit, or whose full diff
|
||||
does not parse, is scanned on its added lines alone, without that context.
|
||||
- `strays`: a new file at the repository root, a new top-level directory, or a
|
||||
scratch name (`zz-*`, `tmp*`, `scratch*`) anywhere.
|
||||
- `literals`: for every changed exported constant or named timeout/retry
|
||||
@@ -380,7 +383,7 @@ The record is `.gstack/tmp/pregate.json` (`gstack-artifact validate --as pregate
|
||||
(`PREGATE_STALE`: rerun after the final stamp), green (`PREGATE_LANE_FAILED`,
|
||||
`PREGATE_INCOMPLETE`, or `PREGATE_ENVIRONMENT` when every incomplete check is
|
||||
the machine's) and every `requires-remote` obligation carries a receipt
|
||||
(`PREGATE_REMOTE_UNCLEARED`: dispatch the job, then
|
||||
(`PREGATE_REMOTE_UNCLEARED`: dispatch the job, wait for it to finish green, then
|
||||
`gstack-pregate clear --remote <workflow.yml/job> --run-url <url>`). The ship
|
||||
receipt then carries `pregate` and `requires_remote`. `gstack-pregate verify`
|
||||
runs the same check standalone.
|
||||
@@ -751,8 +754,25 @@ reads `remote-gate tree=<t12> tests=<n> runs=<id>/<attempt>,… profiles=<p>,…
|
||||
heads=<h12> verified=<time>` (with `accepted-for=` and the substitution for a
|
||||
stamp-only predecessor). A lane with its own profile gets `run tree=… runs=…`
|
||||
the same way; for such a lane `--run-url` is verified as `--run` is, and
|
||||
`--bundle-lane` is refused. A lane with no profile keeps today's `--run-url`
|
||||
recording. When the base config or the GitHub origin cannot be read, `--run`
|
||||
`--bundle-lane` is refused. A lane with no profile still clears by
|
||||
`--run-url`, with run checks (GSTA-203): when the base config and the GitHub
|
||||
origin can be read, `clear` reads the run once and refuses
|
||||
`PREGATE_RECEIPT_INVALID` unless it is a run of this repository whose
|
||||
workflow file is the lane's own `<workflow.yml>`. A run of another workflow
|
||||
refuses with `REUSE: refused reason=workflow_mismatch — run <id> attempt <n>
|
||||
ran .github/workflows/<other>.yml, not .github/workflows/<lane's>.yml`; a
|
||||
run gh cannot read refuses with `api_error`, and a URL that is not an Actions
|
||||
run URL or id on this repository with `run_ref_invalid`. The run must also
|
||||
have finished green (GSTA-203 PR 8): a run that is still queued or running
|
||||
refuses with `run_in_progress`, and one that concluded anything but `success`
|
||||
(`failure`, `cancelled`, `timed_out`, …) with `run_not_success`; each fix line
|
||||
says to rerun the workflow and clear with the green run. The check reads the
|
||||
run's newest attempt, so a `/job/<id>` or `/attempts/<n>` link is judged by
|
||||
the whole run, not that job or attempt, and the lane records
|
||||
`https://github.com/<repo>/actions/runs/<id>/attempts/<n>` for the attempt it
|
||||
judged rather than the link you passed. The job, tree and age are not
|
||||
checked there; that is what a run profile adds. `test_backend/<backend>` lanes and `--bundle-lane` are
|
||||
unchanged. When the base config or the GitHub origin cannot be read, `--run`
|
||||
fails, and so do `--run-url` and `--bundle-lane` unless the base was read and
|
||||
shows the lane has no profile; then the lane is recorded as before, with a
|
||||
warning naming the cause. `gstack-ship-queue ready --dispatch-ci` still
|
||||
@@ -768,7 +788,18 @@ aggregate, `os` Windows). Each accepts `pull_request` and `workflow_dispatch`
|
||||
runs and reads the `tested-tree` artifact, which both aggregates upload only
|
||||
after their strict verification passes. The main-push reuse job and
|
||||
`--from-run` read them. No lane has a profile, so every macOS and Windows lane
|
||||
still clears by `--run-url` as before. A pull request cut before these
|
||||
still clears by `--run-url`, checked for its workflow file and a green
|
||||
conclusion. On main the free tier's Windows smoke lane is
|
||||
`windows-smoke.yml/windows-smoke`, and a `windows-smoke.yml` run clears it.
|
||||
Two narrower Windows lanes are owed only when a branch selects their own test
|
||||
files: `free-tests.yml/cso-windows-launcher` (cleared by a `free-tests.yml`
|
||||
run) and `windows-setup-e2e.yml/windows-setup` (cleared by a
|
||||
`windows-setup-e2e.yml` run). The six-shard
|
||||
`windows-free-tests.yml/windows-free-shard` job is `manual`, so it is never an
|
||||
obligation. A branch cut before
|
||||
`windows-smoke.yml` landed still owes `windows-free-tests.yml/windows-free-shard`
|
||||
from its own workflows, and only a `windows-free-tests.yml` run clears that. A
|
||||
pull request cut before these
|
||||
workflows uploaded `tested-tree` has no record a lane profile could verify, so
|
||||
lane profiles wait until open pull requests carry the producer (GST-555).
|
||||
|
||||
@@ -923,8 +954,11 @@ those, each with its scope and its reason:
|
||||
(`session: HttpSession,`) and a dict entry or Dart named argument that reads
|
||||
a name (`"password": request.password`) are code, not credentials, as they
|
||||
are in TypeScript (#3630). Python's keyword form (`password=request.password`)
|
||||
still reports. The same line inside a `"""` docstring is text and still
|
||||
reports; allowlist it by its value. The pre-push hook sees only added lines,
|
||||
still reports. The same line inside a `"""` docstring, any other string or
|
||||
a Dart `/* */` comment is text and still reports; allowlist it by its value.
|
||||
Code inside a Python f-string or t-string `{…}` field, or a non-raw Dart
|
||||
string's `${…}`, is read as code, and its nested strings and quotes do not
|
||||
end the outer string (GST-738). The pre-push hook sees only added lines,
|
||||
so it scans Python and Dart lines without this exemption and may still warn
|
||||
(MEDIUM, non-blocking) on them.
|
||||
|
||||
@@ -1071,7 +1105,8 @@ with a timing flake: never raise the bound.
|
||||
"answer_markers": ["SEALED ANSWER:"],
|
||||
"seed_patterns": ["shuffle_seed=\\d+"],
|
||||
"local_paths": true,
|
||||
"case_insensitive": true } }
|
||||
"case_insensitive": true,
|
||||
"label_keys": ["stratum", "decoy_set"] } }
|
||||
```
|
||||
|
||||
A repo with a `sealed` key gets a configured local check against accidental
|
||||
@@ -1117,11 +1152,60 @@ gstack-pregate sealed [--range <a..b>] [--remote origin] [--base <branch>] [--js
|
||||
sealed data. Each exempt path is listed on every push (`exempt <rule>
|
||||
<file> commit <sha> (sealed.allow_paths <glob>)`) and counted as
|
||||
`exempt=<n>` on the `SEALED:` line.
|
||||
- **Version skew.** A gstack older than the release whose CHANGELOG adds
|
||||
`sealed.allow_paths` refuses `allow_paths` and `case_insensitive` as
|
||||
unknown keys, so every push and `gstack-pregate run` in the repository
|
||||
fail on that machine. Raise `min_gstack_version` in
|
||||
`.gstack/ship-policy.json` to that release before landing either key.
|
||||
- **Label joins.** Off unless `label_keys` names at least one field. Then
|
||||
`sealed.label_join` refuses a published record that puts a label field next
|
||||
to an identifier, the way a panel row with `stratum` beside `head` and
|
||||
`plan_bytes` tells a model under test which unit it is. A record is a JSON
|
||||
object at any depth (its own fields plus one level of nested objects, named
|
||||
like `meta.head`), a JSONL or NDJSON line, a CSV or TSV row, or a row of a
|
||||
Markdown pipe table (CSV and TSV cells may be quoted). Field names and table headers are compared after
|
||||
trimming, lowercasing and turning spaces and hyphens into underscores
|
||||
(`Tree SHA-256` is `tree_sha_256`); this is the rule's own normalization,
|
||||
separate from `case_insensitive`. An identifier is a field whose name
|
||||
matches an `identifier_keys` glob (`*` is the only wildcard; the default
|
||||
is `head`, `head_sha`, `sha`, `commit`, `tree`, `tree_sha*`, `*_sha`,
|
||||
`*_sha256`, `sha256`, `digest`, `*_digest`, `hash`, `*_hash`,
|
||||
`*_bytes`, `bytes`, `size`, `files`, `lines`), or any string value (or a
|
||||
list holding one) of 7 to 64 hex characters with at least one digit and
|
||||
one letter a to f. An
|
||||
object key of that shape counts as an identifier of the object it holds
|
||||
(shown as `(key)`), so a map keyed by sha joins too. Numbers count only
|
||||
through the field name. A field can be both a label and an identifier, and
|
||||
a record joins when it has a label field and a different identifier field,
|
||||
so adding identifier names to `label_keys` never hides a join. Both lists take bare field names: a nested field
|
||||
matches by its own name (`stratum`, never `meta.stratum`). For each supported file a commit adds,
|
||||
modifies, renames or copies, the guard fingerprints every joined record
|
||||
(sha256 over its label and identifier fields and their values, kept in
|
||||
memory) and compares the set with the parent's version of the file (the
|
||||
rename or copy source; every parent for a merge). A fingerprint no parent
|
||||
has is a finding, so unchanged records and formatting-only edits stay clear,
|
||||
and a replaced, added or widened record refuses even when the count stays
|
||||
the same. A file whose text never names a label key, ignoring double
|
||||
quotes (so `"Strat"um` still names `stratum`), cannot hold a join, so
|
||||
it is skipped without parsing (a commented `tsconfig.json` passes). A file
|
||||
with a `\u` escape, which could spell a label key, is always parsed, so a
|
||||
commented one is `sealed.label_join_unchecked`. A
|
||||
supported file over 4 MiB, one that names a label key and does not parse (one bad
|
||||
JSONL line is enough), one nested deeper than 64 levels, or a blob git
|
||||
cannot read is `sealed.label_join_unchecked`. It refuses too, and the
|
||||
`SEALED:` line counts it as `unchecked=<n>`. Findings print field names
|
||||
(`keys=`, label fields first), never values; `--json` carries them as
|
||||
`keys`. `allow_paths` never exempt either rule; a base-branch waiver does.
|
||||
Both lists are the union of the base branch's and the pushed policy's, each
|
||||
resolved to its default first, so a push can turn the rule on or widen it
|
||||
but never turn it off or narrow it. Without `label_keys` the guard reads no
|
||||
file contents and its output is unchanged. Known limits: joins across files,
|
||||
joins by reference inside a file (a `decoy_set` list naming units described
|
||||
elsewhere), a map from an identifier straight to a label value with no
|
||||
label field name, columnar JSON (`columns` plus `rows`), labels encoded in
|
||||
file names, and prose.
|
||||
- **Version skew.** A gstack older than the release that adds a `sealed` key
|
||||
refuses it as unknown, so every push and `gstack-pregate run` in the
|
||||
repository fail on that machine. `allow_paths` and `case_insensitive` came
|
||||
with the release whose CHANGELOG adds `sealed.allow_paths`; `label_keys`
|
||||
and `identifier_keys` came with the release whose CHANGELOG adds
|
||||
`sealed.label_join`. Raise `min_gstack_version` in
|
||||
`.gstack/ship-policy.json` to that release before landing the key.
|
||||
- **Policy.** The union of the destination base branch's `sealed` and the
|
||||
pushed commit's: a push can tighten it, never relax it (`allow_paths` come
|
||||
from the base branch alone, and a pushed deny glob cannot override one). The
|
||||
|
||||
+18
-8
@@ -570,7 +570,8 @@ ones, and the arm lost blockers. `bin/gstack-review-dispatch` closes both ends:
|
||||
staged manifest (`<dir>/pass-manifest.json`): audit readers marked first, then
|
||||
the specialists with the other audit readers, then the Red Team, then Step 11's
|
||||
voices. A QA extra is refused before any reader is created: Step 9.2.1's probes
|
||||
are the parent's. Each reviewer keeps its plan entry and is rendered by the same code as
|
||||
are the parent's. `--diff-base` sets every reader's base, a scoped pass's Red
|
||||
Team included; the targeted reader keeps the merge base. Each reviewer keeps its plan entry and is rendered by the same code as
|
||||
`render`, once its inputs exist; the Red Team's findings file is the specialists'
|
||||
`merged.jsonl` lines byte for byte. A brief leaves the bin in indexed chunks of at
|
||||
most 65,536 characters (`chunk`), so no tool output line carries a whole brief and a
|
||||
@@ -583,17 +584,26 @@ ones, and the arm lost blockers. `bin/gstack-review-dispatch` closes both ends:
|
||||
fix-check plan renders its reader from `--fix-list`, `--hunks`, `--tests` and `--callers`,
|
||||
`--audit-only` runs just the `--extras` readers (Step 14.5's docs audit), and the fork
|
||||
point is found against `origin/<base>` first, as preflight does.
|
||||
7. Every brief, audit readers' included, ends with a workspace paragraph naming the
|
||||
checkout the bins run in (GST-482): a reader on a shared machine starts in the
|
||||
machine's working directory, so it is told to `cd` there on every command, to give
|
||||
every file tool an absolute path under it, and to start its reply with
|
||||
`REVIEWED_TREE: <HEAD^{tree}> <toplevel>` measured there. The paragraph follows the
|
||||
section's render, which stays byte for byte. `collect` and `mark --state collected`
|
||||
7. Every brief, audit readers' included, opens with a fingerprint step and ends with a
|
||||
workspace paragraph naming the checkout the bins run in (GST-482): a reader on a shared
|
||||
machine starts in the machine's working directory, so it is told to `cd` there on every
|
||||
command, to give every file tool an absolute path under it, and to start its reply with
|
||||
the `REVIEWED_TREE: <HEAD^{tree}> <toplevel>` line the step's command outputs there. The
|
||||
step comes first because a reader following a findings-only format skipped the request
|
||||
when it only closed the brief (GST-897). The section's render sits between the two,
|
||||
byte for byte. `collect` and `mark --state collected`
|
||||
compare that line with the fingerprint recorded at render: a missing or foreign line is
|
||||
`COLLECT_WRONG_TREE`, a later commit in the same checkout `COLLECT_TREE_MOVED`; nothing
|
||||
is merged, the reader becomes `failed`, and `verify` reports `NOT_COLLECTED`. An
|
||||
outside voice's tree failure is recorded `unavailable` only when its reply holds no finding. The line catches a reader that
|
||||
worked elsewhere by accident; it is not proof of reading, since diff text can predict it.
|
||||
worked elsewhere by accident; it is not proof of reading, since diff text can predict it. A `printed:` label
|
||||
before the line (plain, bold or inside its backticks) is still read, and its tree and toplevel are still compared
|
||||
exactly (GST-776). Capy cannot start a subagent in a chosen directory, so before a stage takes a start token or sends
|
||||
its first reader, the Capy pass program compares the checkout with the one shared readers start in (the thread's
|
||||
working directory) and stops when that is another checkout or cannot be read: run /ship in the thread's own checkout.
|
||||
A start directory outside any checkout, such as a multi-repo workspace root, holds no tree to review by mistake and
|
||||
dispatches. Step 11's voices take the `adversarial-review` start
|
||||
token by default, and a `logStart` list without it stops before anything runs.
|
||||
|
||||
## Where this is enforced
|
||||
|
||||
|
||||
+1
-1
@@ -662,7 +662,7 @@ Instead of guessing and patching, it traces data flow, matches against known bug
|
||||
|
||||
## `/verify`
|
||||
|
||||
`/verify` is the loop you run while you build: change something, run the repo's checks, fix what broke, run again. `gstack-checks detect` finds the checks the repo already declares (a `gstack:verify:` line or a `## Health Stack` section in CLAUDE.md, else package.json scripts, tsconfig, eslint or biome, pyproject, Cargo.toml, go.mod) and never makes one up. `gstack-checks run` runs them plus the tests `/ship`'s pre-gate selects for your change, using pregate's own selector, so a green `/verify` predicts a green pre-gate.
|
||||
`/verify` is the loop you run while you build: change something, run the repo's checks, fix what broke, run again. `gstack-checks detect` finds the checks the repo already declares (a `gstack:verify:` line or a `## Health Stack` section in CLAUDE.md, else package.json scripts, tsconfig, eslint or biome, pyproject, Cargo.toml, go.mod) and never makes one up. `gstack-checks run` runs them plus the tests `/ship`'s pre-gate selects for your change, using pregate's own selector, so a green `/verify` predicts a green pre-gate. `/health` finds its tools with the same detector (`gstack-checks detect --for health`), which adds its test, knip, shellcheck and gbrain dimensions.
|
||||
|
||||
It asks once before running any repo command (`gstack-checks trust`) and asks again when a command changes. A touched file no test covers is `UNMAPPED`, a selection that ran zero tests is `ZERO_RUN`, and neither counts as green. A missing tool or service is reported, not worked around. It stops after five runs or when the same failure comes back twice, and sends a stubborn red to `/investigate`. When everything passes, `gstack-checks status` prints `READY_FOR_SHIP tree=<tree>` without rerunning anything, and you run `/ship`. It never reviews, bumps versions, pushes or opens a PR.
|
||||
|
||||
|
||||
+18
-4
@@ -3566,7 +3566,7 @@ base branch's copy or the user-owned file. For the user-owned file, edit it
|
||||
directly at the path the message names. A user file inside the repository, or
|
||||
reached through a symlink into it, is ignored rather than read (`--explain`
|
||||
names it). An unknown `sealed` key that a newer gstack defines (such as
|
||||
`allow_paths` or `case_insensitive`) means this machine's gstack is older than
|
||||
`allow_paths`, `case_insensitive`, `label_keys` or `identifier_keys`) means this machine's gstack is older than
|
||||
the policy: upgrade gstack here, and raise `min_gstack_version` in the
|
||||
repository's `.gstack/ship-policy.json` before landing such a key.
|
||||
|
||||
@@ -3763,6 +3763,15 @@ reads `gstack-pregate clear: receipt refused — REUSE: refused reason=<code>
|
||||
branch's `run_profiles`. Each reason code and
|
||||
what it checks is listed in [run evidence](pregate.md#run-evidence).
|
||||
|
||||
`gstack-pregate clear --remote <workflow.yml/job> --run-url <url>` on a lane
|
||||
with no run profile refuses with this code too, reading `REUSE: refused
|
||||
reason=<code> — …`: `run_ref_invalid` (not an Actions run URL or id on this
|
||||
repository), `api_error` (gh could not read the run), `workflow_mismatch` (a
|
||||
run of another workflow), `run_in_progress` (still queued or running) or
|
||||
`run_not_success` (it failed, was cancelled or timed out). Each prints a fix
|
||||
line; after the last three, clear again with a finished green run of the
|
||||
lane's own workflow ([run evidence](pregate.md#run-evidence)).
|
||||
|
||||
Another tree is accepted in exactly one case: it differs from `pregate.json`'s
|
||||
tree only in the repo's stamp rule (`.gstack/ship-policy.json` on the base
|
||||
branch: `stamp_files`, `stamp_patterns`, the built-in version, manifest,
|
||||
@@ -3864,7 +3873,7 @@ after `clear`), so it clears nothing here; or a `clear --run` receipt names
|
||||
another tree than `pregate.json`'s with no substitution recorded (`run
|
||||
receipt(s) verified for another tree`).
|
||||
|
||||
**Fix.** Dispatch that job, then
|
||||
**Fix.** Dispatch that job, wait for it to finish green, then
|
||||
`gstack-pregate clear --remote <workflow.yml/job> --run-url <url>` (or
|
||||
`--bundle-lane <label>` from an evidence bundle). For `pregate.json/remote_gate`,
|
||||
`clear --remote pregate.json/remote_gate --receipt <gate output>`: the gate's
|
||||
@@ -4175,7 +4184,10 @@ migration is a code change, so the gate reruns.
|
||||
sealed path or transcript (binary, empty and later-deleted files included), or
|
||||
adds a line with a sealed-answer marker, a seed or a local home path, and the
|
||||
destination is public or its visibility is unknown (a new or unreadable
|
||||
repository counts as public). An unreadable or malformed sealed policy refuses
|
||||
repository counts as public). With `sealed.label_keys` set, a new record that
|
||||
puts a label field next to an identifier (`sealed.label_join`), or a supported
|
||||
file the guard could not read (`sealed.label_join_unchecked`), refuses the
|
||||
same way. An unreadable or malformed sealed policy refuses
|
||||
too. The managed pre-push hook and `gstack-pregate sealed` print one line per
|
||||
finding: rule, `file[:line]`, commit. They never print the matched text.
|
||||
|
||||
@@ -4184,7 +4196,9 @@ reaches the public repository (a later commit that deletes it still publishes
|
||||
it). A publishable file kept next to sealed data (a `MANIFEST.json` of hashes
|
||||
and counts) can be exempted from the path rules with a `sealed.allow_paths`
|
||||
glob in the base branch's `.gstack/pregate.json`; the text rules still read it
|
||||
([docs/pregate.md#sealed](pregate.md#sealed)). A reviewed false positive gets
|
||||
([docs/pregate.md#sealed](pregate.md#sealed)). For `sealed.label_join`, drop
|
||||
the identifier fields (or the labels) from the published file, or keep the file
|
||||
out of the public repository; `allow_paths` never exempt it. A reviewed false positive gets
|
||||
one line in the base branch's
|
||||
`.gstack/sealed-allow.tsv`: `rule<TAB>path<TAB>sha<TAB>reason`, where `sha` is
|
||||
the full commit sha (a shortened one is ignored and named on stderr). A private
|
||||
|
||||
@@ -231,6 +231,14 @@ credits outside coverage. A parent reads the rows with
|
||||
`gstack-review-read` and treats `outside_status: unavailable` as missing
|
||||
coverage, not as a clean outside review.
|
||||
|
||||
The pass program (`lib/capy-review-pass.js`) picks the outside voice's model
|
||||
when `input.models['outside-voice']` is empty and the lane model is
|
||||
`anthropic/`: `openai/gpt-6.1-sol` at medium reasoning, the pairing the no-loss
|
||||
rounds ran. Any other lane must name a model. An outside voice from the same
|
||||
provider as the lane model or the native voice stops the pass (`STOP:`) before
|
||||
either voice is created, including on a rerun, and each outside voice prints an
|
||||
`OUTSIDE_VOICE:` line saying whether it is the certified configuration.
|
||||
|
||||
### The carry across a base merge or a test-only fix
|
||||
|
||||
When the parent merges the base in or fixes a test after the receipt was
|
||||
|
||||
Reference in new issue
Block a user