@drawbridge/drawbridge-agents 0.1.88 → 0.1.90

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.
@@ -9,7 +9,7 @@ One Asana release task is the unit. Its id names everything: the `feature/<id>`
9
9
 
10
10
  The ten lines below are the release, as Darren confirmed them on 2026-10-22. The skill owns lines 1 to 5 and 10 and runs them without anyone present once line 2 has its yes. A developer owns 6 and 9. A QA person owns 7 and 8. The skill never does a developer's or a tester's line for them.
11
11
 
12
- 1. A person gives the skill the release task link. The skill checks `gh auth status`.
12
+ 1. A person gives the skill the release task link. The skill runs the doctor, then asks two things before reading anything: who reviews and who tests.
13
13
  2. The skill reads the task and subtasks, writes the stories, sends ONE numbered list and waits for the yes. The yes starts an unattended run.
14
14
  3. Task → Building: branches, the release document, the band.
15
15
  4. The skill builds on the release branches against the Local database, with the QA agent run locally. Nobody is asked anything; whatever needs a person is parked.
@@ -24,6 +24,15 @@ The ten lines below are the release, as Darren confirmed them on 2026-10-22. The
24
24
 
25
25
  Read the release task and every subtask through `drawbridge-tests/lib/asana.js` (`api( 'GET', '/tasks/<id>?opt_fields=name,notes,memberships.section.name' )`, then `/tasks/<id>/subtasks`). Subtasks live in "DrawBridge - Application" (or the Backlog) and stay there. A release is named with one ice cream, in alphabetical order across releases, nothing else: "Almond", "Butterscotch", "Cherry", "Dulce", "Espresso" exist (Darren, 2026-10-22: no numbers, no weeks, no dates; the alphabet carries the order). The date is the task's due field. If asked to create one, take the next letter after the latest in the Releases project. Run `npx drawbridge-agents-release-doctor` from the api checkout first: it checks git, `gh auth status`, `op` on the beta channel, the api's two env files, `scripts/op.sh`, the npm registry and both clusters, and prints one numbered list of what is missing with the fix for each. Stop on any required miss and hand that list to the person. Other developers start releases from their own machines, so nothing is assumed.
26
26
 
27
+ **Then, before the stories, ONE numbered list of two questions**, so the people are known before any work starts and nobody waits for the review to finish (Darren, 2026-10-23: "the first questions asked right away is who is the development reviewer and who is the qa specialist"; "Then any task questions can come after the initial review"):
28
+
29
+ 1. Who on the development team reviews this release: their GitHub username (for the pull requests) and their Asana name (for the task).
30
+ 2. Who tests it: the QA person's Asana name.
31
+
32
+ No organization is asked for, and no test list names one. Nobody can guess which organization a developer or a tester will use, and a link to an organization they cannot open loses the whole session (Jaime, 2026-10-23: a link went to one of Darren's organizations). Each test list instead says what the organization must have (Darren, 2026-10-23: "Open an organization with the following features...").
33
+
34
+ Wait for both answers. Never guess either name. The developer still assigns the QA person at line 6; the name asked here is who that will be.
35
+
27
36
  ## Line 2: the one list
28
37
 
29
38
  **The graph first, grep last.** `git -C ../drawbridge-docs pull` brings the committed knowledge graph (`drawbridge-docs/knowledge/graphs/global.json`, rebuilt at the end of every release); it already knows the family, so a release does not rediscover it by searching sixteen repos from scratch (Darren, 2026-10-22: "make sure we are leveraging the knowledge graphs and not always searching each time we start from develop. That is the point of having that feature"). For every subtask, before any grep: `graphify query "<the subtask in words>"`, then `graphify explain <symbol>` and `graphify affected <symbol>` for the handlers, fields or components it names, all with `--graph ../drawbridge-docs/knowledge/graphs/global.json`. The answers give the repos and files the subtask touches and the cross-repo contracts in play; that list is the Scope table at line 3. Grep only inside a file the graph named, to read it, never across repos to find it.
@@ -31,7 +40,7 @@ Read the release task and every subtask through `drawbridge-tests/lib/asana.js`
31
40
  **Every subtask has a story; no exceptions.** For every subtask, find the existing story or write one (`drawbridge-feature` step 1), from what the graph showed: a bug fix gets the story whose scenario it restores, a new behaviour gets a new story, an internal change gets the story of the behaviour it must keep working. A subtask that ends line 2 with no story is a stop condition, not a gap to fill later: the QA person tests from the story, so a subtask without one has nothing to test against (Darren, 2026-10-22: "all subtasks in a release create or link to an existing story, so there is context about what needs to be tested"). Then ONE numbered list to the person who started the release, each item three plain sentences (`conventions/rules.md` rule 7) plus a fourth, the recommendation, holding:
32
41
 
33
42
  - every unknown from every story, **each with the fix you recommend**: "I recommend <the option>, because <the reason>." The recommendation comes from having read the code the subtask touches (the files the graph named, opened whole) and from what apps like Drawbridge commonly do for the same thing, and it picks the best experience for the person using the product. That goes for every aspect of the platform, not only screens: a feature, a price or plan rule, a design, a message, a default, a limit. A question without a recommendation reads as a question nobody has thought about (Darren, 2026-10-22: "recommend the fix as well. This way I know you've reviewed the code and considered the best approach. We should always be looking at what is the best user experience as well as what is common for apps like ours"). When the recommendation needs a fact you do not have, say which, and still name the option you would take;
34
- - **who on the development team takes the pull requests**: their GitHub username (for the pull requests) and their Asana name (for the task). Asked now so nobody needs to be present between lines 3 and 5. Never guess a reviewer;
43
+ - nothing about who reviews or tests: both were answered at line 1;
35
44
  - **a package publish, if any subtask names `@drawbridge/components` or `@drawbridge/drawbridge-utils`**, as a statement, not a question: this release publishes a package; the developer named above publishes it. The package is built first and gets its own pull request to the package's `main`; the end list (line 5) hands the developer the merge and the publish command; the skill then bumps the pin in every consumer, and the app pull requests open after that, once the publish is done. Line 4 step 2 is the exact sequence.
36
45
 
37
46
  **Publishing is settled; never ask about it.** The developer publishes every package, from the package checkout on `main`, with `git pull && npm run build` (tsup, the tests, `npm publish`, their one-time password). Agents hold no npm token and never will (an agent's `npm publish` answers 401); the automation token (queue task 1218041740718540, in Butterscotch) will move the publish into CI, and until then it is the developer's hand. So the skill never asks who publishes, whether to publish, whether it may publish, or how: it writes the one command into the end list as an instruction to the developer and waits for `npm view` to show the version (Darren, 2026-10-22: "I get a lot of questions in the release about npm publishing etc, lets make sure that it's clear that the developers do the publishing so that these go away").
@@ -87,7 +96,7 @@ Only when every subtask that can be built has been built: each committed, `npm t
87
96
 
88
97
  1. One pull request per repo: `gh pr create --base develop --head feature/<id> --title "Release <id>: <task name>" --assignee <developer> --reviewer <developer> --body <the Scope table, the per-subtask commits, the QA reports' paths, and the migration's dev command if there is one>`. Components and utils target `main`.
89
98
  2. Every pull request body ends with the lane rule in one line: "Review any time, on the feature branch locally. Merge only when develop is free: one release on develop at a time, so this merges once the release before it is Released." Fill the Branches table in `releases/<id>.md` with the PR links; commit.
90
- 3. **How to test, on every subtask, for both readers.** Append to each subtask's description, under its Story lines, two headings (Darren, 2026-10-22: "steps for a developer to test via code, or locally, and a QA person's steps"). First, "Test locally (developer)": one numbered list with the branch to check out, the exact commands (`npm test` in the repo, the test file that proves the change, `npm run migrate -- <id> --dry --env local` when there is a migration, `npm run walk -- --local <path>` for a screen), the localhost URL and the result each command must print or show. Then, "Test on dev (QA)": one numbered list with the dev app to open first by URL (dashboard `https://dev.dashboard.trydrawbridge.com/...`, a share page `https://<slug>.dev.drwbrdg.com/...`, the website `https://dev.trydrawbridge.com/...`, the components app `https://components.trydrawbridge.com/...`), then one action per step, then what the tester must see. Every label in it is quoted from the Local walk and the QA reports of line 4, never from memory (`conventions/walk-the-app.md`), with dev URLs in place of localhost. A migration subtask says what the tester checks after the developer's dev run. The words go through `humanizer`. Both lists are written here, after the build, because only then are the commands and labels known (Darren, 2026-10-22: "include steps on how to test in the respective development apps"). The pull request body and the release doc's QA table point at the subtasks for these steps rather than repeating them.
99
+ 3. **How to test, on every subtask, for both readers.** Append to each subtask's description, under its Story lines, two headings (Darren, 2026-10-22: "steps for a developer to test via code, or locally, and a QA person's steps"). First, "Test locally (developer)": one numbered list with the branch to check out, the exact commands (`npm test` in the repo, the test file that proves the change, `npm run migrate -- <id> --dry --env local` when there is a migration, `npm run walk -- --local <path>` for a screen), and for a screen: "Open an organization with the following features: <what this subtask needs, e.g. a connected Shopify store, a giveaway with a published prize>" on `http://localhost:3000`, then the path inside it by screen name, and the result each command must print or show. Never a fixed organization id. Then, "Test on dev (QA)": one numbered list with the dev app to open first (dashboard `https://dev.dashboard.trydrawbridge.com/organizations`, then "Open an organization with the following features: <what this subtask needs>" and the screens by name from there, never a fixed organization id, a share page `https://<slug>.dev.drwbrdg.com/...`, the website `https://dev.trydrawbridge.com/...`, the components app `https://components.trydrawbridge.com/...`), then one action per step, then what the tester must see. Every label in it is quoted from the Local walk and the QA reports of line 4, never from memory (`conventions/walk-the-app.md`), with dev URLs in place of localhost. A migration subtask says what the tester checks after the developer's dev run. The words go through `humanizer`. Both lists are written here, after the build, because only then are the commands and labels known (Darren, 2026-10-22: "include steps on how to test in the respective development apps"). The pull request body and the release doc's QA table point at the subtasks for these steps rather than repeating them.
91
100
  4. Attach every QA report's screenshots to the release task (`node lib/asana-attach.js <release id> <png>` from drawbridge-tests, one per scenario, named `<subtask id>-<scenario>.png`), because the reports under `results/qa/` are gitignored and exist only on the machine that ran them. Then put the PR links on the release task as ONE numbered list (`drawbridge-asana-comment`): this is the first Asana comment of the release, and the package pull request's link rides in it too. Assign the task to the developer and move it to Review (`POST /sections/1219762451512990/addTask`) only once every pull request is open, parked items included.
92
101
  5. Stop. Report the PR links.
93
102
 
@@ -119,7 +128,8 @@ The skill does none of this. For the record, so the skill can answer "what is th
119
128
 
120
129
  - Push `main`, deploy production, write to the production database, publish a package, merge a pull request, assign the QA person or move the task to QA or Approved. Those are a developer's or a tester's lines. On dev the skill writes nothing of its own either (the refresh only READS dev to copy it into Local); the dev migration runs on a developer's explicit instruction, by the developer or by an agent they ask.
121
130
  - Ask anything about npm publishing: who, whether, how, or for permission. The developer publishes, always; the skill hands them the one command in the end list and waits for the registry.
122
- - Name a reviewer or a release scope that nobody told it; both are asked in line 2. The tester is the developer's choice at line 6 and the window is the developer's at line 9; the skill asks for neither.
131
+ - Name a reviewer, a tester or a release scope that nobody told it; the people are asked at line 1, the scope at line 2. The window is the developer's at line 9; the skill asks for it never.
132
+ - Name an organization in a test list. A developer or a tester opens one that has the features the list names; nobody can guess which they will use.
123
133
  - Write a release document, branch or migration under any name but the Asana id.
124
134
  - Build or run the QA agent against dev or develop before the pull requests merge. Local only.
125
135
 
@@ -68,8 +68,15 @@ skill) so it stops living only in tribal memory.
68
68
  Connections/Workflows warning dots reflect statuses `reconcileWorkflowStatus` writes — every
69
69
  handler must emit **after** the reconcile (regression: sync test/connection-emit-order.test.js).
70
70
  Emitting first hands the client a stale menu nothing re-emits to correct (the stuck-dot bug).
71
- Workflow doc changes have **no** socket event, so app-web workflow status mutations
72
- (pause/resume/delete) invalidate the menu client-side themselves.
71
+ **Since Butterscotch (release 1219790090574059; sync `stream/workflow.js`, components
72
+ `template-socket.js`)** a workflow doc change DOES have a socket event: sync emits
73
+ `organization.workflows` through `lib/emit.js` on every status change, on an `issue` write or
74
+ clear, and on delete, and the shared socket template refetches the open workflow, the list,
75
+ the organization (Next steps) and the menu dot on it. Every status writer passes through that
76
+ stream handler, so a new writer must not emit on its own, and app-web's own invalidation after
77
+ pause/resume/delete is belt and braces, not the mechanism. Before Butterscotch there was no
78
+ event and app-web invalidated the menu client-side itself; a branch cut before it merges still
79
+ behaves that way.
73
80
  - Notification dedupe has two distinct mechanisms — pick by intent. `notification.coalesce`
74
81
  is **last-write-wins supersede** (stream/notification.js deletes the prior doc sharing the
75
82
  key); `notification.key` is **first-write-wins idempotency** — a partial unique index in
@@ -92,7 +99,15 @@ skill) so it stops living only in tribal memory.
92
99
  `APP_CLIENT_WEBHOOKS_URI`) → `buffer` doc → sync drain → platform-global suppression row;
93
100
  api registers the number's SmsUrl at twilio connect (`lib/twilio.js`) and `scripts.js
94
101
  registerTwilioWebhooks` backfills — a deployed webhooks route with unregistered numbers hears
95
- nothing, silently.
102
+ nothing, silently. **Since Butterscotch (release 1219790090574059; sync 762fdd7, Darren
103
+ 2026-10-23: an opt-out is the person's choice, not one address's) `canSend` gates the
104
+ PERSON, not only the address**: it reads the recipient's contact in the organization (found by
105
+ `canonical.emails`/`canonical.phones` or by `leads`) and blocks when any canonical or raw
106
+ address on that contact is suppressed for the channel. `lead` is optional, so every caller
107
+ that knows the lead passes it, or a returning person under a new mailbox passes until their
108
+ contact is rebuilt with the new address. The api's draw opt-out check
109
+ (`route/organization-campaign-draw.js` `optedOutLeads`) applies the same rule and must stay
110
+ in step with it; before Butterscotch both matched the lead's own canonical address only.
96
111
  - **`audience` picks the FROM-address; `intent` picks the unsubscribe plumbing — and NOTHING
97
112
  passes the suppression gate** (utils ↔ sync ↔ api). Every suppression source blocks every
98
113
  lead-facing send, the winner claim included: api's draw route refuses up front ("Disqualify
@@ -412,7 +427,16 @@ skill) so it stops living only in tribal memory.
412
427
  `priority` for fetchpriority=high when it's the LCP element), `defer` gates only the player —
413
428
  never the placeholder, so deferring can't blank the box — and the native poster attribute is
414
429
  kept so unmounting the placeholder at player-ready isn't frame-timing-critical. `onError` fires
415
- exactly once, only after the hls→mp4 retry is exhausted. drawbridge-share's gallery carousel
430
+ exactly once. **Since Butterscotch (release 1219790090574059; components `video.js` and
431
+ `shared/lib/video.js` `videoErrorAction`)** when it fires is decided in one place: a non-fatal
432
+ hls.js error and an `AbortError` (a `play()` cut short by `pause()` or a source swap) are
433
+ ignored; a `NotAllowedError` (the browser refused to start playback, e.g. iOS Low Power Mode)
434
+ fails at once with NO mp4 retry, because the file is fine and the mp4 would be refused too; only
435
+ a FATAL hls.js error takes the one hls→mp4 retry, and `onError` fires when that is exhausted.
436
+ hls.js is bundled into the package and handed to react-player (`provideHls`, `window.Hls` set
437
+ before the player loads), so nothing is fetched from jsdelivr and an ad blocker cannot break
438
+ playback silently. Before Butterscotch, every player error took the retry and `onError` fired
439
+ only after it. drawbridge-share's gallery carousel
416
440
  depends on BOTH callbacks: it advances slides off `onDuration` OR `onError` registering a
417
441
  duration — remove or re-fire either and a broken video stalls the whole carousel (share
418
442
  `template-subdomain-gallery.js`, components `video.js`).
@@ -88,8 +88,15 @@ await removeEntrant( seeded ); // when the walk is done
88
88
 
89
89
  `seedEntrant` writes what the api's thin ingest writes — a zero-count lead and one submission
90
90
  flagged pending — and waits for the sync worker to materialize the entries and every counter.
91
- `removeEntrant` deletes the draws that picked the lead and then the lead; sync's cascade does
92
- the rest and each counter nets back to zero. A lead inserted with its subtotals filled in was
91
+ `removeEntrant` deletes the draws that picked the lead and then the lead, and lifts any denial a
92
+ walk made on the entrant, which outlives the lead by design (drawbridge-api `schema/denial.js`
93
+ keys moderation on the person's canonical identifiers, not the lead id, so no product cascade
94
+ removes it; since drawbridge-tests b081ac1, Asana 1219802418571685); sync's cascade does the
95
+ rest and each counter nets back to zero. **Every `walk+<tag>@…` address is ONE person** to
96
+ moderation and to consent, because `toCanonicalEmail` in utils `lib/email.js` strips the plus
97
+ tag before either looks a person up: a denial or an unsubscribe made on `walk+a@` also covers
98
+ `walk+b@`. Concurrent or later walks that must not share a moderation or consent state use
99
+ different base mailboxes, not different tags. A lead inserted with its subtotals filled in was
93
100
  never counted on its campaign, so deleting it decremented Entries and Submissions below zero
94
101
  (Asana 1218811920761541, 2026-09-23). Counters now floor at zero in sync, but the seed still
95
102
  has to go through the worker or the counts on the walked screen are wrong.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawbridge/drawbridge-agents",
3
- "version": "0.1.88",
3
+ "version": "0.1.90",
4
4
  "description": "Shared agent-instruction content (rules, code style, conventions) for the drawbridge-* monorepo.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {