@thegpvc/gp-foundry 0.2.8 → 0.2.10

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.8",
3
+ "version": "0.2.10",
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 },
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
@@ -40,13 +40,18 @@ Rules of thumb:
40
40
  | `on_complete_label=` | fan_in | label applied on join completion (resolves via config.labels) |
41
41
  | `context=` | agent types | `issue` \| `pr-diff` \| `pr-review` \| `codebase` \| `none` |
42
42
  | `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 |
44
- | `max_attempts=N` | `pr-fix` | loop bound; pairs with an `attempts>=N` escape edge. Counted from the reviewer's submitted request-changes reviews, which cannot be deleted |
43
+ | `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
+ | `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"` |
46
+ | `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
+ | `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
+ | `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
49
  | `paths="memory/"` | `scheduled-agent` | optional allowlist of prefixes this lane may write; anything else is reverted before the push |
46
50
  | `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) |
47
51
  | `secrets="A,B"` | agent types | extra Actions secrets exposed to THIS lane's env (unioned with global `agent.secrets`); least-privilege scoping, e.g. a Sentry token only on the sweeper |
48
52
  | `permissions="id-token: write"` | any job-emitting type | extra GitHub token scopes merged into the job's `permissions:` block (the attr wins on conflict); comma-separated `<scope>: read\|write\|none`. The generic opt-in for GitHub-native capabilities — e.g. `id-token: write` lets a consumer-owned setup step mint an OIDC token and federate into a cloud provider, with all provider specifics in consumer-owned composites |
49
53
  | `timeout=N` | agent types | job `timeout-minutes` (default 35 producer/pr-fix, 20 scheduled-agent). For lanes that run an agent with a salvage epilogue (producer, pr-fix, scheduled-agent) the agent's own step cap is derived as `N − 10`: the 10-min margin lets a cold-cache toolchain setup (~7 min) run and the commit/push/open-PR salvage finish within the job cap, so an over-running agent fails its STEP (salvage still runs) instead of being job-cancelled (#12545/#12611). Raise `N` to give the agent more working time; the margin stays 10 |
54
+ | `agent_attempts=N` | agent types | how many times run-agent invokes the CLI when it fails **transiently** (5xx, overloaded, dropped connection); default 3, backing off 15s and doubling. A real agent error and a usage-limit wall are never retried either way. Set `1` on a lane whose role has an **unconditional** side effect — e.g. the Herald posts a Slack digest with no dedup, so a retry after a partial run would post it twice. Roles that read current state first (the Sentry sweeper's `<!-- sentry:<id> -->` marker, the Supervisor skipping prior escalations) are safe to retry. Distinct from `max_attempts=` above |
50
55
  | `policy="policy/merge.yaml"` | `merge-gate` | merge-policy file |
51
56
  | `schedule="*/30 * * * *"` | `merge-gate`, sweeps | cron cadence |
52
57
  | `environment=NAME` | `human-gate` | GitHub Environment gating approval (**required** on human-gate) |
@@ -29,6 +29,7 @@ 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: