breakaway 2.0.0-main.77 → 2.0.0-main.79

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/README.md CHANGED
@@ -121,8 +121,18 @@ Claude Code asks for your board’s address and its token, which it keeps in you
121
121
 
122
122
  ## Architect
123
123
 
124
+ <picture>
125
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/TheAnarchoX/breakaway/main/docs/media/architect-light.png">
126
+ <img alt="Agents propose it. You approve it. In three steps: 1, an agent changes staging in a pull request, #41, to staging.json. 2, the plan waits for you: 2 changes, 6.40 dollars more a month, estimated, and it can be undone. 3, you press Approve, and the board applies it and checks its health." src="https://raw.githubusercontent.com/TheAnarchoX/breakaway/main/docs/media/architect-dark.png" width="100%">
127
+ </picture>
128
+
124
129
  **In the 2.0.0 pre-releases.** The board can run what your repositories run on too: environments, plans you approve, and incidents, in an **Infrastructure** view, pushes, and `npx breakaway infra`. Code still ships through the deploy flow; Architect looks after what exists around it.
125
130
 
131
+ <picture>
132
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/TheAnarchoX/breakaway/main/docs/media/infra-light.png">
133
+ <img alt="The Infrastructure view, with made-up environments of a repository called widgets on Cloudflare: production is down, 1 of 7 resources, at 24.30 dollars a month inside its 60 dollar budget; staging is healthy, at 13.50 dollars a month inside its 20 dollar budget, and plan-2 waits for you." src="https://raw.githubusercontent.com/TheAnarchoX/breakaway/main/docs/media/infra-dark.png" width="100%">
134
+ </picture>
135
+
126
136
  - **Changed by pull request.** What should exist is a file per environment in `.github/breakaway-infra/`, started from what already runs. A pull request that changes one shows its plan as a check: what changes, what it costs, what else it touches, and whether it can be undone.
127
137
  - **You approve, the board applies.** Every plan waits for you by default, and you approve it from your phone. A workflow in the repository applies it, with its write token in a GitHub environment: the board holds only a read-only token, and agents never apply anything. Bounds you approve once on an environment (an envelope) let it scale and restart inside them.
128
138
  - **It watches.** Health, the platform's alerts, and cost come in as signals. A critical one opens an incident, a task in the repository that owns what broke, and production's push to your phone. Drift and what nobody owns become plans; nothing changes by itself.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "breakaway",
3
- "version": "2.0.0-main.77",
3
+ "version": "2.0.0-main.79",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "breakaway",
9
- "version": "2.0.0-main.77",
9
+ "version": "2.0.0-main.79",
10
10
  "license": "FSL-1.1-Apache-2.0",
11
11
  "bin": {
12
12
  "breakaway": "scripts/tasks.mjs"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "breakaway",
3
- "version": "2.0.0-main.77",
3
+ "version": "2.0.0-main.79",
4
4
  "description": "The task board for you and your coding agents: a Cloudflare Worker, its web app, Taskwarrior sync, and the CLI (npx breakaway).",
5
5
  "license": "FSL-1.1-Apache-2.0",
6
6
  "type": "module",
@@ -23,7 +23,7 @@ const DEFAULT = [
23
23
  'SECURITY.md',
24
24
  ];
25
25
  const KINDS = new Set(['.md', '.html', '.js', '.jsx', '.mjs', '.css', '.json']);
26
- const SKIP = new Set(['node_modules', '.git', 'dist', 'previews', 'logo', 'package-lock.json']);
26
+ const SKIP = new Set(['node_modules', '.git', '.wrangler', 'dist', 'previews', 'logo', 'package-lock.json']);
27
27
 
28
28
  function walk(path, out) {
29
29
  if (!existsSync(path)) return;
@@ -225,8 +225,8 @@ const MAX_WORKERS = 50;
225
225
  const MAX_PAGES = 20;
226
226
 
227
227
  /**
228
- * Paths discover must never call: a KV value, an R2 object, or a Worker's code (BRK-188). Every call is checked against
229
- * these before it's made, so a bug can't turn a read of settings into a read of data.
228
+ * Paths discover must never call: a KV value, an R2 object, a Worker's code (BRK-188), or its logs (BRK-253). Every
229
+ * call is checked against these before it's made, so a bug can't turn a read of settings into a read of data.
230
230
  */
231
231
  export const NEVER_CALLED = [
232
232
  /\/storage\/kv\/namespaces\/[^/]+\/(values|keys|bulk)/u,
@@ -235,6 +235,9 @@ export const NEVER_CALLED = [
235
235
  /\/workers\/scripts\/[^/]+$/u,
236
236
  /\/versions\/[^/?]+\?.*include=modules/u,
237
237
  /\/secrets\/[^/]+$/u,
238
+ // Workers Observability's logs and telemetry, and a Worker's live tail: what its requests carried (BRK-253).
239
+ /\/workers\/observability\//u,
240
+ /\/workers\/scripts\/[^/]+\/tails/u,
238
241
  ];
239
242
 
240
243
  /** A permission as a 403 names it: with its legacy names in parentheses, for a token made before Cloudflare renamed it. */
@@ -70,7 +70,14 @@ export function checkSwitch(value, field) {
70
70
  * @param {{ target: string | null }} row
71
71
  * @param {string} worker the install's Worker
72
72
  */
73
- export const runsTheBoard = (row, worker) => Boolean(row.target) && row.target === worker;
73
+ export const runsTheBoard = (row, worker) => {
74
+ // Compared as names (BRK-253): ` Breakaway ` is still the install's Worker, so no spelling of it escapes observe only.
75
+ const name = (value) =>
76
+ String(value ?? '')
77
+ .trim()
78
+ .toLowerCase();
79
+ return Boolean(name(row.target)) && name(row.target) === name(worker);
80
+ };
74
81
 
75
82
  /**
76
83
  * The environment as the API shows it.
@@ -5,7 +5,8 @@
5
5
  # stops before it reads the write token. That token is CLOUDFLARE_API_TOKEN, a secret of the GitHub environment named
6
6
  # for the environment (for every short-lived environment, the one GitHub environment named short-lived), which only
7
7
  # {{branchName}} may use. It checks out none of this repository's code: it runs breakaway's runner, pinned to
8
- # {{version}}, and reports each step to the board. Agents never run this workflow.
8
+ # {{version}} and installed once, before any step holds the token, from the package's own lockfile with no install
9
+ # scripts, and reports each step to the board. Agents never run this workflow.
9
10
  name: Apply infrastructure
10
11
  run-name: Apply plan ${{ inputs.plan }} to ${{ inputs.environment }}
11
12
 
@@ -47,9 +48,9 @@ jobs:
47
48
  runs-on: ubuntu-latest
48
49
  timeout-minutes: 30
49
50
  environment: ${{ inputs.github_environment || inputs.environment }}
50
- # id-token proves to the board which repository, environment, workflow, and run asks for the plan.
51
+ # id-token proves to the board which repository, environment, workflow, and run asks for the plan. Nothing is
52
+ # checked out, so the run reads nothing of the repository.
51
53
  permissions:
52
- contents: read
53
54
  id-token: write
54
55
  env:
55
56
  BREAKAWAY_URL: ${{ vars.BREAKAWAY_URL }}
@@ -61,16 +62,22 @@ jobs:
61
62
  with:
62
63
  node-version: 22
63
64
 
65
+ # The only download: the package ships npm-shrinkwrap.json and has no dependencies, so this installs exactly
66
+ # what was published, and runs none of its scripts. The steps after it run that copy, so nothing is fetched while
67
+ # the write token is in a step's environment.
68
+ - name: Install the runner
69
+ run: npm install --global --ignore-scripts --no-audit --no-fund breakaway@{{version}}
70
+
64
71
  - name: Check the plan
65
- run: npx --yes breakaway@{{version}} infra runner check
72
+ run: breakaway infra runner check
66
73
 
67
74
  - name: Apply the plan
68
75
  env:
69
76
  BREAKAWAY_WRITE_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
70
- run: npx --yes breakaway@{{version}} infra runner apply
77
+ run: breakaway infra runner apply
71
78
 
72
79
  - name: Report the end
73
80
  if: always()
74
81
  env:
75
82
  OUTCOME: ${{ job.status }}
76
- run: npx --yes breakaway@{{version}} infra runner end
83
+ run: breakaway infra runner end