@thegpvc/gp-foundry 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thegpvc/gp-foundry",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "Compile a directed-graph spec (harness.dot) into an autonomous GitHub Actions agent harness.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -103,7 +103,13 @@
103
103
  "additionalProperties": false,
104
104
  "properties": {
105
105
  "base_branch": { "type": "string", "minLength": 1 },
106
- "branch_prefix": { "type": "string", "minLength": 1 }
106
+ "branch_prefix": { "type": "string", "minLength": 1 },
107
+ "authors": {
108
+ "type": "array",
109
+ "minItems": 1,
110
+ "items": { "type": "string", "minLength": 1 },
111
+ "description": "Only pull requests opened by these GitHub logins reach the PR lanes (pr-review, pr-fix, PR-context analysts, review panels, sweeps). Case-insensitive. A node's own authors= attribute overrides it for that lane."
112
+ }
107
113
  }
108
114
  },
109
115
  "labels": {
@@ -33,6 +33,11 @@ Rules of thumb:
33
33
 
34
34
  ## Node attributes (DOT `[...]`)
35
35
 
36
+ This table is the whole vocabulary. An attribute that is not in it — a typo, or one
37
+ from a newer gp-foundry — is a **build error** (`attr.unknown`), on nodes and edges
38
+ alike: it would otherwise compile cleanly and do nothing, which is the worst possible
39
+ outcome for an attribute meant to *restrict* a lane.
40
+
36
41
  | attr | on types | meaning |
37
42
  |------|----------|---------|
38
43
  | `type=` | all | the node type (required) |
@@ -42,7 +47,8 @@ Rules of thumb:
42
47
  | `output=` | `analyst` | `comment` \| `doc:<path-glob>` (docs-only write allowlist) |
43
48
  | `gates="ci.yml, lint / eslint, e2e?90"` | `pr-review` | the CI the review depends on; each conclusion is put in front of the reviewer, and the job timeout grows to cover the waits. An entry ending in `.yml`/`.yaml` waits on that **workflow**; any other entry is a **check-run name** — the way to gate on one job of a larger workflow, or on a check Actions did not produce (external CI, a status app). Check-runs are read with `GITHUB_TOKEN` (the job gains `checks: read`), since a fine-grained PAT cannot hold the Checks permission. A trailing `?N` is the grace, in seconds, to wait for the target to *appear* before concluding `skipped` (default 90) — raise it for a slow-starting check, lower it for one that only runs on some heads. Names cannot contain a comma |
44
49
  | `skip="draft,bot-author,label:<key>,unchanged-diff"` | `pr-review` / PR-context `analyst` | PRs this lane does **not** review. Compiles to a `<node>_guard` job (read-only, no agent, no checkout) the lane's job is `needs:`-chained behind. `draft` — a draft PR (the lane also listens for `ready_for_review`, so it runs the moment the draft is marked ready). `bot-author` — opened by a bot (dependabot, renovate…); the harness's own `identity.bot_login` is exempt. `label:<key>` — carries the label `labels.<key>` resolves to (re-evaluated on the next event, not when the label is removed). `unchanged-diff` — a **push** whose merge-base diff hashes the same as the one this bot last reviewed, i.e. a rebase or a merge from base that left the change itself untouched; the workflow stamps the hash into the review as `<!-- gp-foundry:diff:<node>:<sha256> -->` after the agent posts it. Needs `identity.bot_login`. Every guard read fails **open** — an unreadable PR is reviewed, never silently skipped. Not available on diamond legs or sweep lanes |
45
- | `select="sweep"` | `pr-review` (with `schedule=`) | the **approver** pattern: instead of reacting to one PR's event, the lane runs on its cron and a `<node>_select` job deterministically picks the heads ready for a decision, then fans the lane out over them as a matrix. A head is selected when the PR is open, not a draft, on a `repo.branch_prefix` branch, **and** no review request is outstanding, **and** every check-run on the head is completed with no commit status pending, **and** no review by `identity.bot_login` carrying `**Verdict:**` exists on that exact head SHA. Oldest first, at most 10 per tick; a head whose state cannot be read is left for the next tick. "Concluded" is not "green" — a failed check is an answer the role must weigh — and a head with no checks at all counts as concluded. The lanes ahead of a sweep must post analyses, never `**Verdict:**`: the first verdict on a head is the decision. Requires `context="pr-diff"` or `"pr-review"` |
50
+ | `authors="dpup, octocat"` | `pr-review`, `pr-fix`, PR-context `analyst` | an allowlist: the lane runs only on pull requests **opened by** these logins (case-insensitive). Enforced twice — as a job-level `if:` on the event payload, so no runner is spent on anyone else's PR, and again in the `<node>_guard` job against the live PR, where it **fails closed** (an author that cannot be verified is skipped; every other guard check fails open). A sweep applies the same filter in its select job. Set `repo.authors: [dpup]` in `foundry.config.yaml` to bind every PR lane (and review panels) at once; the node attribute overrides it for that lane. Without either, a PR lane runs on every PR whose branch matches `repo.branch_prefix` |
51
+ | `select="sweep"` | `pr-review` (with `schedule=`) | the **approver** pattern: instead of reacting to one PR's event, the lane runs on its cron and a `<node>_select` job deterministically picks the heads ready for a decision, then fans the lane out over them as a matrix. A head is selected when the PR is open, not a draft, on a `repo.branch_prefix` branch, **and** no review request is outstanding, **and** every check-run on the head is completed with no commit status pending, **and** no review by `identity.bot_login` carrying `**Verdict:**` exists on that exact head SHA, **and** the lane has not already run there. That last condition is the sweep's own record: after the lane succeeds on a head, a `<node>_mark` job publishes the check-run `gp-foundry/swept (<node>)` on it (neutral, written with `GITHUB_TOKEN`), so a role that posts nothing — a shadow run, an abstention — is not handed the same head again every tick. A lane that fails leaves the head unmarked and is retried. Oldest first, at most 10 per tick; a head whose state cannot be read is left for the next tick. "Concluded" is not "green" — a failed check is an answer the role must weigh — and a head with no checks at all counts as concluded. The lanes ahead of a sweep must post analyses, never `**Verdict:**`: the first verdict on a head is the decision. Requires `context="pr-diff"` or `"pr-review"` |
46
52
  | `cancel_in_progress=true\|false` | agent types | whether a newer event for the same issue/PR **cancels** the run in flight rather than queueing behind it. Default `false` (`true` for `issue-agent`). Good for a reviewer — a review of a superseded head is waste. On a lane that writes code (producer, pr-fix, committing scheduled-agent) the validator warns: cancellation skips the commit/push salvage, so unpushed work is lost |
47
53
  | `checkout="partial"` | any node that checks out | a blob-less clone with full history (`fetch-depth: 0` + `filter: blob:none`): every commit and tree, file contents on demand. `git log`, `git blame` and merge-base diffs work as in a full clone without paying for every version of every file — for big repos where the reviewer needs history |
48
54
  | `max_attempts=N` | `pr-fix` | fix↔review **loop** bound; pairs with an `attempts>=N` escape edge. Counted from the reviewer's submitted request-changes reviews, which cannot be deleted. Unrelated to `agent_attempts=` below — this counts trips round the loop, that counts CLI invocations within one run |
@@ -35,6 +35,7 @@ agent: # the coding-agent CLI + default model
35
35
  repo:
36
36
  base_branch: main
37
37
  branch_prefix: agent/ # branches look like agent/<issue>-slug (matches policy branch_prefix)
38
+ # authors: [your-login] # only PRs opened by these logins reach the PR lanes (or authors="…" per node)
38
39
 
39
40
  labels: # semantic key -> actual repo label. Guards (`when="label=build"`) resolve
40
41
  # through this map, so renaming a repo label is a one-line change HERE —
@@ -1,6 +1,7 @@
1
1
  # scope.yaml — the invariants from interview Q2. Canonical, CI-enforced.
2
2
  # immutable_paths: agents can NEVER modify these. Three things enforce it, and
3
- # `gp-foundry build` wires up all three: the generated immutable-guard.yml fails
3
+ # `gp-foundry build` wires up all three: the generated immutable-guard.yml (emitted
4
+ # whenever the graph has a lane that writes code) fails
4
5
  # any agent-branch PR whose diff touches one, agent-fallback strips such edits
5
6
  # before a lane pushes (including the scheduled lanes that commit straight to the
6
7
  # base branch), and the merge gate holds back a PR that reaches it anyway. This