@thegpvc/gp-foundry 0.2.9 → 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.9",
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",
@@ -29,7 +29,7 @@
29
29
  "node": ">=20"
30
30
  },
31
31
  "bin": {
32
- "gp-foundry": "./dist/cli/index.cjs"
32
+ "gp-foundry": "dist/cli/index.cjs"
33
33
  },
34
34
  "files": [
35
35
  "dist/cli",
@@ -78,6 +78,10 @@
78
78
  "type": "string",
79
79
  "description": "Name of the Actions secret holding the agent OAuth token."
80
80
  },
81
+ "api_key_secret": {
82
+ "type": "string",
83
+ "description": "Name of the Actions secret holding an Anthropic API key. When set, agents authenticate with it INSTEAD of the OAuth token: usage-billed and not bound to one person's subscription seat."
84
+ },
81
85
  "secrets": {
82
86
  "type": "array",
83
87
  "items": { "type": "string", "minLength": 1 },
@@ -99,7 +103,13 @@
99
103
  "additionalProperties": false,
100
104
  "properties": {
101
105
  "base_branch": { "type": "string", "minLength": 1 },
102
- "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
+ }
103
113
  }
104
114
  },
105
115
  "labels": {
package/skill/SKILL.md CHANGED
@@ -132,7 +132,8 @@ config (`labels:` in `foundry.config.yaml`), never hardcoded strings.
132
132
 
133
133
  Fill `foundry.config.yaml`: `identity` (App-id/App-key **secret names**, bot login,
134
134
  git name/email — never a literal like `dixie-agent[bot]`), `agent.cli`/`agent.model`/
135
- `agent.oauth_token_secret`, `repo.base_branch`/`repo.branch_prefix`, `labels`, and
135
+ `agent.oauth_token_secret` (or `agent.api_key_secret` — an Anthropic API key used
136
+ *instead*, when the agents should not run on one person's seat), `repo.base_branch`/`repo.branch_prefix`, `labels`, and
136
137
  `runtime.mode` (`vendored` default — `gp-foundry vendor`/`up` copies the runtime actions
137
138
  into the repo; switch to `pinned` + a SHA once the actions repo is public). Size/merge
138
139
  policy lives in `agents/policy/merge.yaml`, not the config. If a toolchain is needed,
@@ -173,8 +174,8 @@ paths:
173
174
  Then fill in the four spec surfaces you drafted from the interview:
174
175
 
175
176
  - **`harness.dot`** — the graph. Nodes carry `type`, `role="agents/roles/<name>.md"`, and typed
176
- attrs (`context`, `gates`, `max_attempts`, `schedule`, `policy`, `environment`,
177
- `output`). Edges carry `on=` and/or `when=`. See `templates/harness.dot` and
177
+ attrs (`context`, `gates`, `skip`, `select`, `max_attempts`, `schedule`, `policy`,
178
+ `environment`, `output`, `checkout`, `cancel_in_progress`). Edges carry `on=` and/or `when=`. See `templates/harness.dot` and
178
179
  `reference/node-types.md`.
179
180
  - **`agents/roles/<name>.md`** — one per agent node. Front-matter (`role`, `type`, `mission`,
180
181
  `accountable_for`, `inputs`, `outputs`, `handoffs`, `tools`, `quality_bar`) + prose
@@ -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) |
@@ -40,7 +45,12 @@ Rules of thumb:
40
45
  | `on_complete_label=` | fan_in | label applied on join completion (resolves via config.labels) |
41
46
  | `context=` | agent types | `issue` \| `pr-diff` \| `pr-review` \| `codebase` \| `none` |
42
47
  | `output=` | `analyst` | `comment` \| `doc:<path-glob>` (docs-only write allowlist) |
43
- | `gates="ci.yml,..."` | `pr-review` | named check workflows the review depends on; each conclusion is put in front of the reviewer, and the job timeout grows to cover the waits |
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 |
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 |
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"` |
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 |
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 |
44
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 |
45
55
  | `paths="memory/"` | `scheduled-agent` | optional allowlist of prefixes this lane may write; anything else is reverted before the push |
46
56
  | `commit="none\|pr\|direct"` | `scheduled-agent` | how the lane persists output: `direct` (default) commits to base; `pr` opens a reviewed PR; `none` no commit/push (read-only lane) |
@@ -29,11 +29,13 @@ agent: # the coding-agent CLI + default model
29
29
  cli: claude
30
30
  model: claude-opus-4-8
31
31
  oauth_token_secret: CLAUDE_CODE_OAUTH_TOKEN # gh secret set CLAUDE_CODE_OAUTH_TOKEN --body <token>
32
+ # api_key_secret: ANTHROPIC_API_KEY # use an Anthropic API key INSTEAD of the seat-bound OAuth token
32
33
  # allowed_tools: "Read,Write,Edit,Glob,Grep,Bash(git:*),Bash(gh:*)" # roles may widen/narrow
33
34
 
34
35
  repo:
35
36
  base_branch: main
36
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)
37
39
 
38
40
  labels: # semantic key -> actual repo label. Guards (`when="label=build"`) resolve
39
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