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

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
@@ -1460,6 +1460,9 @@ var PLAN_LIMIT = /upgrade to github (pro|team)|make this repository public/i;
1460
1460
  function isPlanLimit(error) {
1461
1461
  return PLAN_LIMIT.test(error ?? "");
1462
1462
  }
1463
+ function gateOn(org) {
1464
+ return org.review_gate === true || org.review_gate === "on";
1465
+ }
1463
1466
  function judgeGate(r) {
1464
1467
  if (isPlanLimit(r.error)) {
1465
1468
  return {
@@ -1793,7 +1796,8 @@ function buildPlan(ws, org, handle, opts, parseYaml) {
1793
1796
  labels,
1794
1797
  secrets,
1795
1798
  warnings,
1796
- skipGate: opts.reviewGate === false,
1799
+ // Off unless org.yaml turns it on. See gateOn.
1800
+ skipGate: opts.reviewGate === false || !gateOn(org),
1797
1801
  commits
1798
1802
  };
1799
1803
  }
@@ -3753,6 +3757,16 @@ async function checkOrgOnline(ws, org) {
3753
3757
  return out;
3754
3758
  }
3755
3759
  async function checkReviewGates(ws, org, composer) {
3760
+ if (!gateOn(org)) {
3761
+ return [
3762
+ {
3763
+ scope: "workspace",
3764
+ id: "review-gate",
3765
+ level: "ok",
3766
+ title: "review gate is off: staff are told to leave merging to you, and GitHub does not enforce it"
3767
+ }
3768
+ ];
3769
+ }
3756
3770
  const repos = new Set(
3757
3771
  (org.repos ?? []).filter((r) => r.role === "product").map((r) => `${org.org}/${r.name}`)
3758
3772
  );
@@ -4937,6 +4951,11 @@ agent:
4937
4951
  # options:
4938
4952
  # provider: openrouter
4939
4953
 
4954
+ # Have GitHub require a reviewed pull request before anything merges into a product repo.
4955
+ # Off by default: on private repos GitHub only enforces it on a paid plan. Staff are told to
4956
+ # leave merging to you either way. See docs/security.md.
4957
+ review_gate: false
4958
+
4940
4959
  defaults:
4941
4960
  model: ${o.model}
4942
4961
  timeout_minutes: 90
@@ -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, 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). |
42
+ | `review-gate` | Off unless `review_gate: true` is in `org.yaml`, and then a note that it is off. When on, 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/org-yaml.md CHANGED
@@ -39,6 +39,7 @@ defaults:
39
39
  mention_timeout_minutes: 90
40
40
 
41
41
  budget: 300
42
+ review_gate: true
42
43
 
43
44
  staff:
44
45
  - { handle: cto, dir: technology, name: Chief Technology Officer, schedule: "0 7 * * 1-5" }
@@ -61,6 +62,7 @@ repos:
61
62
  | `ops_dir` | no | Directory name of the ops repo in the runner checkout. Defaults to `roster-ops`. |
62
63
  | `experiment_private` | no | Whether the fact that this org is agent-run is itself private. Read by the guardrails fragment. |
63
64
  | `budget` | no | USD over any trailing 30 days, for the whole org. See [below](#budget). |
65
+ | `review_gate` | no | `true` to have GitHub require a reviewed pull request before anything merges into a product repo. Off by default, because private repos need a paid plan for it. See [security](security.md#the-review-gate). |
64
66
 
65
67
  ### `human` and `humans`
66
68
 
package/docs/security.md CHANGED
@@ -55,21 +55,24 @@ The rule: **the default branch of every product repo requires a pull request wit
55
55
  approving review, and no staff App is on the list of who may bypass it.** A ruleset or classic
56
56
  branch protection both count.
57
57
 
58
- `roster doctor` reads it for every `role: product` repo in `org.yaml` and every repo a staff
58
+ **It is off unless you turn it on**, with `review_gate: true` in `org.yaml`. Without it, staff
59
+ are told to leave merging to you, and on Pip they always have, but GitHub does not stop them.
60
+ Most orgs keep product repos private on the Free plan, where GitHub cannot enforce the rule.
61
+
62
+ With it on, `roster doctor` reads it for every `role: product` repo in `org.yaml` and every repo a staff
59
63
  member `works_in`, as `review-gate`. It fails when nothing requires a PR or a staff App can
60
64
  bypass the rule, and warns when a PR is required with no approval, since then whoever opened
61
65
  it can merge it.
62
66
 
63
- `roster hire --apply` adds a ruleset named `roster: review before merge` to each product repo
67
+ With it on, `roster hire --apply` adds a ruleset named `roster: review before merge` to each product repo
64
68
  that does not already require an approving review, and leaves anything stricter alone. Pass
65
69
  `--no-review-gate` to skip it. The ruleset lets repository admins bypass it only by merging a
66
70
  pull request, so your own merge is still the approval (GitHub will not let you approve your
67
71
  own PR) and an App, which is never an admin, cannot merge at all.
68
72
 
69
73
  **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.
74
+ branch protection on private repos for paid plans. To use the gate there, make the product repo
75
+ public or move the org to GitHub Team.
73
76
 
74
77
  To set it by hand: repo **Settings -> Rules -> Rulesets -> New branch ruleset**, target the
75
78
  default branch, tick **Require a pull request before merging** with one required approval, and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanocollective/roster",
3
- "version": "0.1.0-alpha.19",
3
+ "version": "0.1.0-alpha.20",
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": {