browser_review_gate 0.5.7 → 0.5.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b2af284e2c18316fda05c544c9ac48e449bd2f437889cafb35fc3f87e5d8daf
4
- data.tar.gz: 446778283b56f4e20414950e2630fc0dac57860e8a73d00ba82feee330fcc5dc
3
+ metadata.gz: 49ea48971ae5589a3a7728e445eb225941190a85123003aad55839be15168f58
4
+ data.tar.gz: 46a3cea56550060fc64777036270cc1c8cbaa09cd2c31fa0bd8a8ff86646ba39
5
5
  SHA512:
6
- metadata.gz: ea4c28b00ced0d23e6d8da77cbaf81702d4e2a9837f841dec8aa996a667ac18d12378124c8fa90692906c63075863e9bbbb0d1945c5adf263ac7292b8e048008
7
- data.tar.gz: 920f904ef1cd723082eaf8dcd31eca3e3d0494bfca3a3c84a0be74e3d620cf98e7da8242d07ce3e6a83ceec6fc30d0338923de0735eaf0523327223014bd698d
6
+ metadata.gz: 10ae00bc951d49ccbf3946145eb6d9d5ba5b6a13abd5ab0ebda7a6ad78ec4952468731f9ccdec34c9bdc3638d438ea2a5dcc19a4b40bb0ab1115350dddc93445
7
+ data.tar.gz: 8581df4e94b784f8d7459974d75afcf99b4b66b7ec11690b9495ea7eea6fb0c31b8c94d3909c7b8756a6dd34e3790a161e07bf5509626c13c463ae3836579c02
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.8
4
+
5
+ - `environments.NAME.serve_command`, added in 0.5.6, is removed. Which command an agent may run to
6
+ restart the app is a project's own rule: on `serve_local_head` the agent asks the person, unless the
7
+ project's instructions or `.github/browser-review-gate/rules.md` say how it may do that itself.
8
+ Re-run `browser-review-gate install` to update the playbook.
9
+
3
10
  ## 0.5.7
4
11
 
5
12
  - The revision check before a run reads the header as the trace check does: a short SHA names the
data/README.md CHANGED
@@ -80,7 +80,6 @@ environments:
80
80
  url: "http://localhost:3000" # what the agent opens
81
81
  healthcheck: "/up" # path on url, or a full URL; what verify/doctor ask
82
82
  start_command: "bin/dev" # what the person runs; nothing starts the app automatically
83
- serve_command: "bin/docker-serve" # optional: the one command the agent may run to serve its checkout
84
83
  sign_in: "Use the seed accounts from db/seeds.rb"
85
84
  staging:
86
85
  url: "https://staging.example.com"
@@ -144,7 +143,7 @@ Off by default. A report is the agent's account; `provenance.trace` lets the gem
144
143
 
145
144
  It adds `X-App-Revision: <HEAD SHA>` to every response and follows new commits without a restart. Any other way of sending the header works too; name it in `provenance.revision_header`.
146
145
 
147
- `verify` and `status` read the header before a run too, whatever `trace` is: when the app names another commit than the checkout's HEAD, the outcome is `serve_local_head` instead of a run, so an agent never tests code it did not check out. With `serve_command` set on the environment, the agent runs it and starts again; without it, it asks the person.
146
+ `verify` and `status` read the header before a run too, whatever `trace` is: when the app names another commit than the checkout's HEAD, the outcome is `serve_local_head` instead of a run, so an agent never tests code it did not check out. The agent asks the person to restart the app from its checkout, unless the project's instructions or rules say how it may do that itself.
148
147
  2. Set `provenance.trace` to `warn` (results shown in the PR) or `require` (a passing case counts only with a verified trace). `doctor` checks that the app sends the header and that it matches the checkout.
149
148
  3. The agent records a trace per case and lists it as `evidence.trace`: a Playwright `trace.zip`, the `.network` log Playwright MCP writes with `browser_start_tracing`/`browser_stop_tracing` (start the MCP server with `--caps devtools`), or a HAR network log (`.har`). HAR is a standard format that Playwright, Chrome DevTools ("Save all as HAR") and many other tools write, so the check does not need Playwright itself. A browser tool that can save neither cannot satisfy `require`; `doctor` and `verify` warn about it before a run.
150
149
 
@@ -53,7 +53,7 @@ module BrowserReviewGate
53
53
  TRACE_MODES = %w[off warn require].freeze
54
54
  ASSESSMENTS = %w[ci local].freeze
55
55
 
56
- ENVIRONMENT_KEYS = %w[url healthcheck start_command serve_command sign_in].freeze
56
+ ENVIRONMENT_KEYS = %w[url healthcheck start_command sign_in].freeze
57
57
  MANDATORY_KEYS = %w[id name why paths matrix].freeze
58
58
 
59
59
  def self.load(root = Dir.pwd)
@@ -121,7 +121,7 @@ module BrowserReviewGate
121
121
  environment = @config.environment(name)
122
122
  return { "name" => nil, "reachable" => nil, "note" => "No environment is configured in #{Config::PATH}." } unless environment
123
123
 
124
- details = environment.slice("name", "url", "healthcheck", "start_command", "serve_command", "sign_in")
124
+ details = environment.slice("name", "url", "healthcheck", "start_command", "sign_in")
125
125
  details["reachable"] = environment["url"] ? @probe.call(Status.healthcheck_url(environment)) : nil
126
126
  details["served_revision"] = @revision_probe.call(Status.healthcheck_url(environment)) if details["reachable"]
127
127
  details
@@ -6,10 +6,7 @@
6
6
 
7
7
  # Where the app runs for a browser run. The agent opens `url`; `healthcheck` (a path on `url`, or a
8
8
  # full URL) is what `verify`, `status` and `doctor` ask to see whether the app answers. Nobody starts
9
- # the app automatically: `start_command` is what the person runs. `serve_command` (optional) is the one
10
- # command the agent may run itself, from its checkout, to make a running app serve that checkout's code
11
- # (for example a script that points a Docker stack at a git worktree); verify asks for it when the app's
12
- # revision header names another commit. `sign_in` is a hint such as "use the
9
+ # the app automatically: `start_command` is what the person runs. `sign_in` is a hint such as "use the
13
10
  # seed account from db/seeds.rb"; never put real credentials here, this file is in the repository.
14
11
  # A cloud agent cannot reach localhost: give it an environment with a URL it can reach (staging, a
15
12
  # preview deployment) and select it with `--environment`.
@@ -16,14 +16,14 @@ This file is the playbook for the AI coding agent that does the run. The person
16
16
  - `published` / `not_verified`: a run saved for this commit was published. Report the result and stop.
17
17
  - `open_pull_request`: a run is saved and waits for the PR. Tell the person to open it.
18
18
  - `ask_to_start_app`: the environment does not answer. Do not start it yourself: ask the person to start it (`environment.start_command` says how) and stop until they have.
19
- - `serve_local_head`: the app answers with another commit (`environment.served_revision`). When `environment.serve_command` is set, run it from this checkout and start again; it is the one command you may run to point the app at your code. Otherwise ask the person to serve this checkout and stop until they have.
19
+ - `serve_local_head`: the app answers with another commit (`environment.served_revision`), so a run would test code you did not check out. Ask the person to restart it from this checkout (`environment.start_command` says how) and stop until they have, unless the project's instructions or `<%= rules_path %>` say how you may do it yourself; then do that and start again.
20
20
  - `run_and_publish` or `run_and_save`: continue with step 2.
21
21
  2. Decide what to run. `assessment` in the output says who chooses.
22
22
  - `local`: you choose. Read the diff against the base branch and `<%= rules_path %>`, and pick every scenario a person would need to exercise the change; `scenarios` holds only the mandatory ones from the settings, and they must be included. If nothing the change does can be seen or done in a browser (for example a background job whose result no page shows), you may publish a report with `"not_required": { "reason": "..." }` and `"cases": []` instead; the reason is shown in the PR, so make it specific. Every new commit that touches more than documentation, tests or CI needs a fresh run.
23
23
  - `ci`: `scenarios` is the list CI wrote for this PR, with each one's `status` (`missing`, `failed`, `blocked`, `skipped`, `stale`). Run every one of them and give each case the `id` of its scenario. Scenarios marked `critical` or in the `mandatory` category come from the project settings; they cannot be left out. You may add cases of your own; you may not drop or rename one from the list.
24
24
  - With no PR yet, or an empty list, choose the scenarios yourself: read the diff against the base branch, then `<%= rules_path %>`, which says what this project always checks. Its rules are mandatory. CI compares your cases with its own list once the PR is open and asks for what is missing.
25
25
  - Do not re-run a scenario whose earlier case still counts; `verify` lists only what is owed.
26
- 3. Open `environment.url` in your browser tool. `environment.sign_in` is a sign-in hint. Never start, restart or stop the app yourself, except through `environment.serve_command` as step 1 says. Use test data and do not destroy existing data. If the app, the data or a browser tool is missing, report the blocker. Reading code and running unit tests does not replace a browser run.
26
+ 3. Open `environment.url` in your browser tool. `environment.sign_in` is a sign-in hint. Never start, restart or stop the app yourself, except as the project's instructions allow for `serve_local_head` in step 1. Use test data and do not destroy existing data. If the app, the data or a browser tool is missing, report the blocker. Reading code and running unit tests does not replace a browser run.
27
27
  4. Run every scenario end to end. For each case record:
28
28
  - `url`: the page it was exercised on; `details`: what you observed;
29
29
  - evidence, as `policy.agent` in the `verify` output asks: screenshots (`never`, `on_failure`, `always`), a trace, and the console errors and failed requests you saw (`[]` when there were none). Save files in a directory outside the repository, next to the report.
@@ -64,12 +64,9 @@ module BrowserReviewGate
64
64
 
65
65
  def self.serve_instructions(status)
66
66
  environment = status["environment"] || {}
67
- served = "#{environment["url"]} serves #{environment["served_revision"]}, not this checkout's HEAD (#{status["local_head"]})."
68
- if environment["serve_command"]
69
- "#{served} Run `#{environment["serve_command"]}` from this checkout, then run verify again."
70
- else
71
- "#{served} Ask the person to serve this checkout#{environment["start_command"] ? " (#{environment["start_command"]})" : ""}; do not restart the app yourself."
72
- end
67
+ "#{environment["url"]} serves #{environment["served_revision"]}, not this checkout's HEAD (#{status["local_head"]}). " \
68
+ "The app must run from this checkout#{environment["start_command"] ? " (#{environment["start_command"]})" : ""}: ask the person " \
69
+ "to restart it, unless the project's rules say how you may do it yourself. Then run verify again."
73
70
  end
74
71
 
75
72
  def self.run_instructions(status)
@@ -1,3 +1,3 @@
1
1
  module BrowserReviewGate
2
- VERSION = "0.5.7"
2
+ VERSION = "0.5.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browser_review_gate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Islam Gagiev