@nanocollective/roster 0.1.0-alpha.18 → 0.1.0-alpha.19

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/dist/cli.js CHANGED
@@ -1456,7 +1456,18 @@ function short2(e) {
1456
1456
  import { mkdtempSync, rmSync, writeFileSync as writeFileSync2 } from "fs";
1457
1457
  import { tmpdir } from "os";
1458
1458
  import { join as join12 } from "path";
1459
+ var PLAN_LIMIT = /upgrade to github (pro|team)|make this repository public/i;
1460
+ function isPlanLimit(error) {
1461
+ return PLAN_LIMIT.test(error ?? "");
1462
+ }
1459
1463
  function judgeGate(r) {
1464
+ if (isPlanLimit(r.error)) {
1465
+ return {
1466
+ level: "warn",
1467
+ title: `${r.repo} can't require reviews: GitHub only allows that on private repos with a paid plan`,
1468
+ fix: "Make the repo public, or move the org to GitHub Team. Until then, staff can merge their own pull requests, so check what gets merged."
1469
+ };
1470
+ }
1460
1471
  if (r.error) {
1461
1472
  return {
1462
1473
  level: "warn",
@@ -2057,7 +2068,10 @@ async function ensureGate(repo, apps) {
2057
2068
  return `review gate on ${repo}: ${judgeGate(now).title}`;
2058
2069
  }
2059
2070
  const added = await addGate(repo);
2060
- return added.ok ? `added a review-before-merge ruleset to ${repo}` : `could not add a review gate to ${repo}: ${added.error}. See docs/security.md.`;
2071
+ if (added.ok) return `added a review-before-merge ruleset to ${repo}`;
2072
+ if (isPlanLimit(added.error))
2073
+ return judgeGate({ repo, approvals: null, bypass: [], error: added.error }).title;
2074
+ return `could not add a review gate to ${repo}: ${added.error}. See docs/security.md.`;
2061
2075
  }
2062
2076
  function wirePeers(ws, plan2, root) {
2063
2077
  const { staff } = plan2;
@@ -39,7 +39,7 @@ ran at all.
39
39
  | `workflows` | No workflow in the repo is failing run after run. Reported for the ops repo here, and for each brain repo under its staff member. |
40
40
  | `workflows.failing` | **fail.** A workflow that is not one of roster's callers has failed at least its last two runs, with the date it started. Skipped and cancelled runs are stepped over. This is the canary that goes red and stays red, because whatever would have said so broke with it. |
41
41
  | `budget` | Trailing 30-day spend against a `budget` in `org.yaml`, for the org here and for a staff member under their name. A warning when it is past, never a failure, and only read when a budget is set. Cost comes from each run's record, so it says how many runs it could price. See [cost](cost.md#budgets). |
42
- | `review-gate` | One per product repo. **fail** when nothing requires a pull request on its default branch, or a staff App can bypass the rule; a warning when a PR is required with no approving review, or the settings cannot be read. See [security](security.md#the-review-gate). |
42
+ | `review-gate` | One per product repo. **fail** when nothing requires a pull request on its default branch, or a staff App can bypass the rule; a warning when a PR is required with no approving review, when the repo is private on GitHub Free (which can't enforce the rule), or when the settings cannot be read. See [security](security.md#the-review-gate). |
43
43
  | `upgrade` | The tenant is in sync with the framework. |
44
44
  | `upgrade.stale` | Generated files are behind. `roster upgrade --apply`. |
45
45
  | `upgrade.owned` | **fail.** A framework-owned file was edited in the tenant. Move the change upstream or the next upgrade reverts it. |
package/docs/prompts.md CHANGED
@@ -99,6 +99,12 @@ than a hang.
99
99
  | `ops.dir` | ops repo directory in the checkout |
100
100
  | `staff` | the whole of this staff member's `staff.yaml` |
101
101
  | `staff.dir` | where their brain lands in the checkout |
102
+ | `staff.handle`, `staff.name` | their handle (`cto`) and role name (`Chief Technology Officer`) |
103
+ | `staff.brain` | their brain repo, `owner/name` |
104
+ | `staff.bot` | the login they post as on private repos, e.g. `acme-cto[bot]` |
105
+ | `staff.public_bot` | the login they post as on public repos |
106
+ | `staff.public_token_env` | the environment variable holding the public repo token during a run |
107
+ | `staff.status_issue` | the number of their pinned status issue |
102
108
  | `staff.product` | **first entry of `works_in`, or null** |
103
109
  | `staff.product.repo` | that repo's `owner/name` |
104
110
  | `peers` | list of the other staff members |
package/docs/security.md CHANGED
@@ -66,6 +66,11 @@ that does not already require an approving review, and leaves anything stricter
66
66
  pull request, so your own merge is still the approval (GitHub will not let you approve your
67
67
  own PR) and an App, which is never an admin, cannot merge at all.
68
68
 
69
+ **On GitHub Free, private repos can't have this rule.** GitHub only enforces rulesets and
70
+ branch protection on private repos for paid plans, so `review-gate` warns instead. Make the
71
+ product repo public or move the org to GitHub Team. Until then, staff can merge their own pull
72
+ requests.
73
+
69
74
  To set it by hand: repo **Settings -> Rules -> Rulesets -> New branch ruleset**, target the
70
75
  default branch, tick **Require a pull request before merging** with one required approval, and
71
76
  keep the staff Apps off the bypass list.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanocollective/roster",
3
- "version": "0.1.0-alpha.18",
3
+ "version": "0.1.0-alpha.19",
4
4
  "description": "An agent-run org, powered by GitHub. Scaffold AI staff members whose brain is a repo.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -35,6 +35,7 @@ const KNOWN = {
35
35
  "prompts/mention.md": "The instructions when you @-mention someone.",
36
36
  "prompts/_identity.md": "Who staff post as.",
37
37
  "prompts/_paths.md": "Where files are during a run.",
38
+ "prompts/_inflight.md": "Pull requests people have open, so staff don't work on the same files.",
38
39
  };
39
40
 
40
41
  const GROUPS = [