Skip to content

revamp(pass 6): signed change pings wake member agents; the SDK checks writes and answers - #1353

Merged
teddashh merged 11 commits into
mainfrom
revamp/pass-6
Nov 15, 2026
Merged

teddashh merged 11 commits into
mainfrom
revamp/pass-6

Conversation

@teddashh

@teddashh teddashh commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Pass 6 of the platform revamp. A member's agent no longer has to poll for changes: the member can give one agent key an optional address, and the platform sends it a small signed wake-up ping when that key's change feed has something new. The agent then reads the feed with its own key, exactly as before. The agent SDK also gets safer writes and answers, verifies pings, and is now served by the platform.

Stacked on #1352 (pass 5). The first six commits are #1352's. Review only the last five:

  1. 3d1f5a134 server;
  2. 9454891be SDK;
  3. 925d2379f an SDK cross-check test;
  4. eb58ac6fe screen and docs;
  5. b487141c4 the sweep re-checks each claimed ping right before it sends (review 5912365882), and the guild-launchpad migration frontier (Verify 43750320886).

When #1352 merges, this diff shows only pass 6.

1. What a member sees

  • In 自動化 → 我的 Agent, each live key with 讀取 has one optional block, 變更通知(選填).
    • It has one field, 通知網址, and 儲存.
    • Once an address is saved, 送測試通知 and 停止通知 appear.
  • One status line reports the latest outcome. It reads one of:
    • 尚未送出通知;
    • 上次通知成功:;
    • 上次通知失敗:,將自動重試;
    • 已暫停:連續 8 次失敗(上次:). A successful test ping resumes a paused one.
  • Nothing else on the screen changed.

2. The protocol, freedom.agent-ping/v1

  • The request is a POST <notify_url> with these headers:
    • Content-Type: application/json;
    • User-Agent: FreedomWorkshop-AgentPing/1;
    • Freedom-Ping-Id;
    • Freedom-Ping-Timestamp (unix seconds);
    • Freedom-Ping-Signature: v1=<hex>.
  • The body is exactly {"format":"freedom.agent-ping/v1","ping_id":…,"connection_id":…,"test":false}. It carries no member data.
  • The signature is HMAC-SHA256 over freedom.agent-ping/v1\n<timestamp>\n<body>.
    • The key is the ASCII text of the key's stored token_hash, the SHA-256 hex of the agent's token. So there is no new secret, and the key rotates with 續期換新.
    • A database reader could forge a ping. A ping grants nothing, though: it can only make the agent read its own feed with its own key.
  • Success is any 2xx within 5 s. Each failure is recorded as timeout, network, redirect (any 3xx), http_status or rejected_url.
  • The receiver verifies the raw body, allows 300 s of clock skew, compares in constant time, and then reads GET /api/v1/agent/events.
  • A shared test vector is reproduced by the server's signer and by the SDK's verifier.

3. Safety decisions

  • Destinations. Only provider-hosted HTTPS subdomains are accepted: *.workers.dev, *.pages.dev, *.netlify.app and *.vercel.app, each with 1 or 2 labels.
    • These are the guild tools' Worker rule, now in one shared check (packages/shared/hosted-destination.ts).
    • github.io is excluded because it cannot take a POST, and so is the platform's own host.
    • A port, userinfo, query, fragment, whitespace, backslash or control character is refused.
  • Delivery. It never follows a redirect, sends no cookies and reads no response body.
    • The URL is checked when it is saved and again before every send.
    • The sender only fetches the notify_url it read from the database row, never a URL from a request.
  • Who sets it. Only the member, in the browser, and only on a live key with read. An agent key gets 403.
  • Which keys are pinged. Revoked, expired and suspended keys are never pinged, and neither are inactive or onboarding-pending accounts.
  • Renewal. 續期換新 moves the address to the new key in the same transaction. It is dropped when the new key lacks read.
  • Stopping is checked when a ping is admitted; it is not cancelled atomically. The sweep's last check is a plain SELECT right before the sends.
    • A stop, revoke or renewal that commits after that read can still let one already-admitted ping go out.
    • The ping carries no member data, and the agent then reads its feed with its own key, which is refused once the key is revoked.
    • /agent.md#change-ping already says pings may repeat and that the change list is the only source of truth.
  • Kill switch. FREEDOM_AGENT_PINGS_DISABLED=true stops the sweep and makes the test route answer 503 agent_pings_unavailable. Unset means on, so no deploy configuration changes.

4. Server

  • migrations/215_agent_change_pings.sql. One additive table, one row per agent key. Domain writers and their triggers are untouched, so pings add no lock or write to any domain transaction.
  • Cursor helpers. The feed's cursor assignment is split into lockAgentChangeCursor and assignAgentChangeCursors, with the same SQL. readAgentFeed calls them in the same order, and its idle statement-count test is unchanged.
  • Routes:
    • POST /me/agent-tokens/:id/ping saves or clears the address. It is a command with an Idempotency-Key.
    • POST /me/agent-tokens/:id/ping/test sends one test ping now. It is limited to 10 per hour per member.
    • The key list carries each key's ping view.
  • The sweep. It runs in the existing 10-minute cron, right after auth pruning.
    • It claims at most 10 due rows in one statement (FOR UPDATE … SKIP LOCKED, with a 2-minute lease), assigns pending feed cursors, and sends the pings concurrently, 5 s each.
    • It records each outcome fenced by the lease token. A re-save clears the lease, so a sweep that was already sending records nothing.
    • Right before sending, it re-reads every claim with one plain SELECT, which never waits for a row lock. The claim's key and member rules, this sweep's lease and an unpaused row must still hold. The ping goes to the address read there and is signed with the key read there. A claim that no longer passes sends nothing and records nothing: stopped, moved, revoked, renewed, expired, suspended, lost read, inactive or onboarding pending.
    • Failures back off 1, 5, 15 and then 60 minutes, and pause after 8.
    • Several changes coalesce into one ping, by pinged_cursor.
  • Lock order. The sweep takes the ping row, then the member's cursor row. Saving takes the key, then the ping row. No path takes the ping row and then the key.

5. SDK (packages/sdk/agent-client.mjs)

  • Writes. Every non-GET call needs an idempotencyKey (8 to 128 of [A-Za-z0-9_-]) and fails before any request without one. newIdempotencyKey() returns a UUID.
  • Answers. A successful answer must be application/json within 2,000,000 bytes. A failed answer stays an AgentError with its status, even when its body is a proxy's HTML.
  • verifyAgentPing({token, body, headers}) checks a ping with WebCrypto only and throws AgentPingError (ping_malformed, ping_expired, ping_signature_invalid).
  • Served copies. The platform serves byte-identical copies at /agent/sdk/v1/agent-client.mjs and agent-operations.mjs, with Access-Control-Allow-Origin: *. check:agent-contract covers them.
  • Discovery gains sdk and change_ping.
  • /agent.md#change-ping documents the ping and shows a six-line Worker handler. build-on-freedom.md no longer says there are no webhooks.

Tests

Locally, on the pass-6 changes over #1352's earlier heads. The rebase onto #1352's head b460e4bea adds only that pull request's two browser-test fixes, and the pass-6 changes are byte-identical after it:

  • Static checks: typecheck, module:check (no surface_unmapped), check:agent-contract (51 operations), check:runtime-text, git diff --check.
  • Runtime:
    • New agent-change-pings, 10 cases:
      • the URL rules;
      • the test vector;
      • save, clear, reset and renewal;
      • an agent key gets 403;
      • the test route's resume, backoff, 429 and 503;
      • sweeps on a new change, a late commit, and the feed afterwards;
      • 500, 302 and timeout failures, the pause at 8, and a re-save during a sweep;
      • every dead-key and dead-account state;
      • 12 due rows give 10 pings, and two concurrent sweeps ping each row once;
      • a sweep held at the member's cursor row (pg_blocking_pids) while one of nine changes commits sends nothing for that claim: stop, re-save, revoke, renew, expiry, suspension, lost read, inactive member and onboarding pending. Afterwards a re-save pings only the new address, and a renewal pings once with the new key. A control with no change pings once. This case fails on the code before the fix.
    • The SDK cross-check: the SDK verifies a swept ping with the agent's own token, and after 續期換新 the old token is refused.
    • Agent files: agent-tokens-ui 13, sdk-agent-client 11, agent-discovery 3, agent-door 70 (unedited), agent-mcp 14, agent-share-answers 5, automation-ux-m07 2, security-review-agent 10.
    • Guild tools, after the shared check moved: guild-tool-worker-fetch 8 and guild-tools 18, both unedited.
    • Every runtime file that runs the scheduled handler:
      • auth-pruning 20, commerce-scheduler 21, shares 38;
      • event-participation-api 27, member-connections 21, maintainer-worker 7;
      • worker-adapter 38, commerce-contact-retention 18, admin-sync-worker 9;
      • commerce-effect-journal 35.
  • Worker: all 140 tests/worker cases, with the three dry-run bundles built. workerd starts the bundle that now contains the sweep.
  • Deploy and governance: deploy/cloudflare/test 1093 (the migration frontier is now 215), and governance 74. The contracts pytest (docs/platform-plan/contracts/tests and docs/platform-plan/execution/tools/tests) gives 970, with the guild-launchpad README now at repo_max_migration=215.
  • Browser, with CI's pinned Playwright configuration:
    • agent-door saves https://my-agent.example-user.workers.dev/ping and sees 尚未送出通知;
    • an http: address is refused with the server's message;
    • 停止通知 clears the address;
    • shares, private-work-ai and member-avatar-asset pass too.
    • No test sends a real ping.
  • CodeQL CLI with the default code-scanning suite, on this head against revamp(passes 1-4): five places, guild tools, share credit, agent door, events, build from your own repository #1348's merged head: nothing new. On the fix commit, against the previous pass-6 head: the same 9 results. Two test-code incomplete-url-substring-sanitization alerts from an earlier draft were fixed by comparing the suffix lists exactly.

Two more test changes come with this:

  • auth-pruning.test.ts no longer calls setFixtureRolePasswords. Its roles already log in with their own random password, and the call reset them to PGPASSWORD, so password-auth databases failed with 28P01. CI's trust auth is unaffected.
  • The commerce-scheduler and github-sync-scheduled mocks inject the new agentPings seam, so the real sweep does not run against them.

Deploy notes

  • Migration 215 adds one table; nothing else in the schema changes.
  • No configuration change is needed: pings are on unless FREEDOM_AGENT_PINGS_DISABLED=true.
  • Outbound traffic. The Worker cron sends at most 10 small POSTs per tick, only to member-chosen provider-hosted subdomains.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

teddashh and others added 5 commits November 15, 2026 13:37
…pment proposals

A member's fw_agent_ key with the share scope can now create, read, list and
revise their private skill-book drafts and save private development proposals
through the existing member routes. No new route, scope or migration; the
older fpk_/fpg_/fpd_ keys, their screens and endpoints are unchanged.

- Allowlist skills.drafts, skills.draft_read, skills.draft, skills.revise,
  development.status and development.propose; publish, grant, revoke,
  upgrade, illustration, upload keys, consent, activate, keys and revoke
  stay person-only (documented granted:false entries).
- Development access checks the caller explicitly: person-only actions
  refuse an Agent actor; status and proposals lock the Agent connection and
  re-check its clock, and receipts use the agent/<connection>/<operation>
  namespace like every other Agent write.
- Journals record source 'agent' and the connection id for Agent drafts,
  revisions and proposals.
- Contract, MCP description and SDK operations regenerated (51 operations).
- The skill submission and development screens point to 自動化 → 我的 Agent;
  docs describe the one-key way first and keep the older keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A member who just created a store saw four workspace tabs and no hint of
what comes next. Until the store is first published, the store page now
shows three steps above the tabs: 商店資料已建立 ✓, 新增第一件商品 (or
已新增 N 件商品 ✓), and 在「店面與發布」預覽後發布 (or, without publish
permission, 請有發布權限的成員預覽後發布). One 「前往下一步」 button opens
the next tab and moves focus to its panel; it hides when that tab is
already open.

The list is derived from data the page already reads (publication state,
product count, writable, store:write, store:publish). It shows only while
the store has never been published, is writable, and the member can write,
so an owner who unpublished on purpose is not nagged.

Tests: hosted-store-next-steps (new, 9), hosted-store-areas fingerprints
for the two panels that now take tabIndex={-1}, and the member journey
checks the list, the button, focus, 320 px width and that the list is gone
after publishing and after signing in again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
publicShareReturnPath already accepted only /services/<uuid> and /works/<uuid>, but it rebuilt the
path as `/${match[1]}/${match[2]}`. CodeQL could not see that the first segment is one of two
literals, so it reported js/client-side-unvalidated-url-redirection at App.tsx 635, 641 and 706
(alerts 145 and 146 on #1348). The path is now rebuilt from constant /services/ and /works/
prefixes, as publicDiscoveryPath already does.

Checks:
- The output is the same for every input: 17 cases, including //host, schemes, uppercase and
  extra segments.
- CodeQL CLI 2.27.4 gives 3 results for that query before the change and 0 after.
- works-public and member-services pass 24/24 with CI's pinned Playwright configuration.
- typecheck passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Choosing a kind in 待處理's 種類 filter wrote view=<kind> with no manage parameter. On load and on
Back, every view other than the three places was read as a management screen unless it said
otherwise. So a reload or Back opened the management screen instead of the filtered inbox
(review 5910486477, P3).

The URL now says which one it is:
- A kind filter or an opened item writes manage=0, a management screen writes manage=1, and the
  three place views write neither.
- On load, on Back and after an admin account change, manage=1 opens management and manage=0
  does not. A view link with no manage predates the places, so it still opens its management
  screen.

Test: admin-places filters to 檢舉處理, reloads, opens the item, reloads, goes Back and finds the
filtered inbox again; /admin?view=held-shares still opens the management screen. On the old code
the filter is gone after the first reload. The five admin specs pass 72/72 with CI's pinned
config (after rebuilding the portal bundle), and typecheck passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ist read

An event opened by its path or by #events/<id> was read once at mount and again when the first
list read landed, because the selected-read effect depends on items. An unlisted event flickered
(detail, loading, detail again) and a listed one cost a wasted read. In event-detail-retry's path
entry, a list landing after a failed first read re-ran the read and raced the retry button.

- EventsPanel: the selected-read effect waits while initialLoadPending is true. The flag clears
  in load's finally, after success or failure, and the panel remounts on a session change, so the
  wait always ends. While no read exists the detail region shows 正在載入活動….
- event-route-identity: start() no longer settles a detail read of A that now waits for the list,
  or never happens when A is listed. The three remount cases settle the list and check that the
  new owner's own read exists before the stale response races it. No case was removed and no
  assertion was weakened.
- Four other runtime files built "detail first, list late" races that the guard removes. They now
  reach the same race through a real path: the first list read fails, the detail opens, 重試
  starts a list read that lands late while the draft or write is open.
- event-detail-retry.spec: a 1280px case holds every directory read, sees 正在載入活動… and no
  detail read after 500 ms, then runs 503, 重新讀取活動 and B with exactly two detail reads. It
  fails without the guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@detna-vibe-coding detna-vibe-coding left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the four pass-6 commits against pass 5 (5267d2b), at exact head 6a603f0. One P2 blocker remains in cancellation/current-authority handling before dispatch; see the inline finding.

The other reviewed boundaries are sound so far: browser-only owned-key settings, fixed provider-hosted HTTPS destinations, no redirects/cookies/response-body consumption, renewal/drop behavior, bounded signed payloads and no token/hash in outbound data, SDK write-key preflight and bounded response handling. An independent exact-source probe passed 10/10 for URL rejection, server/SDK signature interoperability, tamper/rotation/clock/format rejection, transport options, every write's key requirement, failed-response status retention and byte-identical served SDK files. This does not substitute for hosted SQL/HTTP/browser suites.

The cancellation probe uses the exact sweep function with a gated cursor port and synthetic DB rows, not a real PostgreSQL concurrency run or real HTTP sends. It shows dispatch still occurs after the modeled stop commits. Please add a real DB barrier regression around the cursor wait when fixing it. Hosted Verify 43750320886 is still queued; approval also awaits that exact-head evidence.

@detna-vibe-coding detna-vibe-coding left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional exact-head CI blocker, separate from the outstanding pre-dispatch cancellation finding: Verify 43750320886 / governance-consumers job 132923083237 failed ci.contracts-pytest. The log reports 268 passed and 8 failed in docs/platform-plan/execution/tools/tests/test_guild_launchpad_status.py; the earlier skill-client, runtime-union, pinned-pytest and consumer-repository suites passed.

The PR adds migration 215, but docs/platform-plan/execution/guild-launchpad/README.md still declares repo_max_migration=214. I independently executed the exact validator source and its status inputs in a bounded local materialization containing the exact new migration: status_failures reports README glp-status repo_max_migration=214 but migrations/ (code) is 215. An in-memory change of only that declared repository frontier to 215 makes this status check pass. This is not a claim that I reran all 276 pytest cases (pytest is not available locally).

Please regenerate the README status with python3 docs/platform-plan/execution/guild-launchpad/validate-spec-pack.py --write-status, updating its human-readable current-status section as directed by the validator. Do not advance observed staging/production schema, release or acceptance fields merely because a repository migration was added. Obtain a fresh successful hosted governance run along with the cancellation fix and full required checks. No repository edit or CI rerun performed.

teddashh and others added 6 commits November 15, 2026 14:41
…nd the admin manage address

Verify 43748603240 on #1352 failed two browser shards (reviews 5912457863 and 5912487828).

- ui-default (3), share-launcher.spec.ts:228. The no-publication check collected every POST on
  the page. The 動態 feed records a read for any post that stays half visible for a second
  (SocialInteractions.tsx). A post made earlier in the shard by mobile-install.spec.ts was on
  screen, so its read receipt counted as a write. The spec is unchanged from main. It failed only
  because the hosted runner was slow enough to keep the feed in view for a second.
  Both page-wide collectors in this spec now skip that one request,
  POST /api/v1/social-posts/<id>/read, and still count every other POST. A new check pins that
  the skip matches only that path: not posting, editing, commenting, liking or public sharing,
  and not other read receipts. The other page-wide POST collectors in tests/e2e were checked too.
  None of them is on the member feed without a path filter.
- ui-default (2), github-setup.spec.ts:138. Since 5cea403 the admin menu writes manage=0 for
  a screen that is not a management list, so the setup screen's address is
  /admin?view=github&manage=0. The test now reads that exact same-origin address right after
  opening setup and expects it again after the refused target. That lets the
  zero-outbound-request and enabled-button checks after it run again. No other e2e check compares
  an address written by the admin menu with an anchored pattern.

Tests: with a two-second pause on the feed added to the three share tests, the old collectors
fail all three on the read receipt, as the hosted run did; with this change all three pass.
Without the pause, mobile-install, share-launcher and github-setup pass with the pinned config,
and typecheck passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A member can now give one agent key an optional HTTPS address. When the key's change feed has
something new, the platform sends that address a thin signed wake-up ping, and the agent reads
GET /api/v1/agent/events with its own key, as before. Polling stays the source of truth.

- Protocol freedom.agent-ping/v1: POST with Freedom-Ping-Id, -Timestamp and -Signature
  (v1=hex HMAC-SHA256 keyed by the ASCII token_hash over "freedom.agent-ping/v1\n<ts>\n<body>").
  The body names only the ping, the connection and whether it is a test. A database reader could
  forge a ping, but a ping carries no data and grants nothing.
- Destinations: provider-hosted HTTPS subdomains only (workers.dev, pages.dev, netlify.app,
  vercel.app), never the platform's own host. The guild tools' raw-authority check moves to
  packages/shared/hosted-destination.ts and both features use it; guild tool behaviour is
  unchanged. Delivery never follows a redirect, sends no cookies and reads no body. The URL is
  checked when saved and before every send, and the sender only uses the URL from the row.
- migrations/215_agent_change_pings.sql: one row per key, coalesced by pinged_cursor.
- The feed's cursor assignment is split into lockAgentChangeCursor and
  assignAgentChangeCursors with the same SQL; readAgentFeed calls them in the same order.
- POST /me/agent-tokens/:id/ping saves or clears the address (browser only, live key with read).
  POST /me/agent-tokens/:id/ping/test sends one test ping now (10 per hour; a success resumes a
  paused ping). The list carries each key's ping view, and 續期換新 moves the address.
- The 10-minute cron sweeps after auth pruning: at most 10 pings per tick, 5 s each, fenced by a
  lease token. Failures back off 1/5/15/60 minutes and pause after 8. Dead keys, inactive and
  onboarding-pending accounts are never pinged. FREEDOM_AGENT_PINGS_DISABLED=true stops the
  sweep and makes the test route 503; unset means on.
- Migration frontier 214 -> 215 in the deploy tests and release compatibility.
- Scheduler tests that drive createWorkerHandler with a mock pool inject the agentPings seam.
- tests/runtime/auth-pruning.test.ts: the setFixtureRolePasswords call is removed. The test's
  roles already log in with their own random password, and the call reset them to PGPASSWORD, so
  password-auth databases failed with 28P01. Merge d03498e resolved the same pair this way for
  google-identity-runtime-role; CI's trust auth is unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and a served SDK

The member agent SDK (packages/sdk/agent-client.mjs) works in production but left three things to
each agent author. Pass 6 closes them:

- Writes: every non-GET call now needs an idempotencyKey (8-128 of [A-Za-z0-9_-]) and fails before
  any request without one. newIdempotencyKey() returns a UUID; reuse it when retrying.
- Answers: a successful answer must be application/json and at most 2,000,000 bytes, read as a
  stream. A failed answer stays an AgentError with its status and code; a body that is not a JSON
  Problem (a proxy's HTML 502) or is over the cap keeps the status as http_<status>.
- Pings: verifyAgentPing checks a freedom.agent-ping/v1 wake-up ping with WebCrypto only (format,
  then time, then the HMAC keyed by the token's SHA-256 hex, then the exact JSON), and throws
  AgentPingError with ping_malformed, ping_expired or ping_signature_invalid. The blueprint's test
  vector verifies, and node:crypto reproduces it in the test.

The platform serves byte-identical copies at /agent/sdk/v1/agent-client.mjs and
agent-operations.mjs (generated by build-agent-contract.mjs, so --check covers them) with
Access-Control-Allow-Origin: *. Discovery gains sdk {client_url, operations_url, types}; /agent.md
and build-on-freedom.md name the URLs and newIdempotencyKey(). client.mjs is unchanged.

Built by agy (Gemini 4 Hydrogen) from the lead's brief; the lead kept failed answers as AgentError
and registered the served copies in client-connections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n token

The server tests checked each ping's signature with the server's own signer. With the SDK on
this branch, the sweep case now also verifies the ping with verifyAgentPing and the agent's
token, as an agent would. After 續期換新, the new token verifies the ping and the old token is
rejected with AgentPingError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…explain pings

- 自動化 → 我的 Agent: each live key with 讀取 gets one optional block, 變更通知(選填), with one
  field (通知網址), 儲存, and once an address is saved 送測試通知 and 停止通知. One status line says
  尚未送出通知, 上次通知成功:<time>, 上次通知失敗:<reason>,將自動重試, or 已暫停 with the last
  reason. The actions reuse the screen's flight guard, error line and reload.
- /agent.md has a 變更通知(選用) section (#change-ping): what a ping is, the headers, the body,
  the signed message and its key, a six-line Worker handler using verifyAgentPing from a saved
  copy of the served SDK, and "answer 2xx quickly; the feed stays the source of truth".
- Discovery gains change_ping {format, signature, key, settings, guide_url}.
- build-on-freedom.md replaces "there are no webhooks" with the change ping; the Cloudflare
  README documents FREEDOM_AGENT_PINGS_DISABLED.
- Tests: agent-tokens-ui (which keys get the block, save/test/stop with a fresh Idempotency-Key
  and a reload, every status line and failure reason, the flight guard), agent-discovery, the
  guide test, and an agent-door browser journey that saves, is refused for http:, and stops.
  No test sends a real ping.
- agent-change-pings checks the two suffix lists exactly instead of with .includes('github.io'),
  which CodeQL reads as an incomplete URL check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review 5912365882 (P2): the sweep checked the key and the member only in its
claim. Each claim then waits for the member's cursor row, and every claim waits
for the whole loop, before any POST. A member who stopped or re-saved the
address, or revoked or renewed the key meanwhile, or a key that expired, still
got a ping at the old address; the lease fence only dropped the record.

- After every step that can wait on a lock, one plain SELECT re-reads all
  claims with this sweep's lease and the claim's own rules (now one shared
  PINGABLE_KEY_SQL). The ping is built from the URL and key hash read there.
  A plain SELECT does not wait for row locks, so nothing blocks between it and
  the sends. A stale claim sends nothing, records no attempt, and gives its
  lease back after the sends.
- The test route already reads the key and the address in one read after its
  rate-limit write, and nothing waits between that read and its send.
- New PostgreSQL barrier test. It holds the member's cursor row, starts a
  sweep and waits until the sweep is blocked on that row. Then it stops,
  re-saves, revokes, renews, expires, suspends, drops read, deactivates the
  member or makes onboarding pending, and releases the row. None of these
  sends anything, and the next sweep follows the current state. A control
  with no change still sends once. On the old sweep the test fails at its
  first change (one POST to the stopped address).

Also: migration 215 moves the guild-launchpad spec pack's repo_max_migration
to 215 (README 目前狀態 and its glp-status line, regenerated with
validate-spec-pack.py --write-status). Verify 43750320886's
governance-consumers failed on it in ci.contracts-pytest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teddashh

Copy link
Copy Markdown
Contributor Author

Pushed b487141c4. Pass 6 is now five commits on #1352's new head b460e4bea. The first four are unchanged by the rebase (git range-diff shows =), and the fifth is new.

  1. Review 5912365882, P2: the sweep sent to an old address. Fixed. The sweep now re-checks each claim right before it sends; details are in the resolved thread.
  2. Verify 43750320886, governance-consumers: the migration frontier.
    • The failure. ci.contracts-pytest failed 8 of 276 cases in test_guild_launchpad_status.py. The guild-launchpad README's status said repo_max_migration=214, but migrations/ now reaches 215.
    • The fix. The README gets the 第六輪 sentence, and its status line is regenerated with validate-spec-pack.py --write-status. Only repo_max_migration=215 changed.
    • The rest of the migration checklist was already done: environments.json migrations.last, the release-compatibility ledger and FOUNDATION_NAMES, and the migration-plan, event-missions, community-certification, profile-publication and release-compatibility tests.
  3. revamp(pass 5): agent keys save private drafts; new stores show 開店步驟 #1352's two browser-test fixes. revamp(pass 5): agent keys save private drafts; new stores show 開店步驟 #1352's new head fixes the two browser checks from its Verify 43748603240, and this branch includes them.

Local checks on the fix commit:

  • Static: typecheck, module:check and git diff --check.
  • Runtime: agent-change-pings 10/10, agent-door 70/70, agent-tokens-ui 13/13, auth-pruning 20/20, worker-adapter 38/38 and commerce-scheduler 21/21.
  • Worker: the three worker dry-run bundles, then all 140 tests/worker cases.
  • Contracts pytest: both directories, 970 passed.
  • CodeQL CLI, default suite: the same 9 results as on the previous head.

Waiting for the exact-head hosted Verify.

@detna-vibe-coding detna-vibe-coding left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incremental review of b487141 after the rebase: recursive tree comparison with 6a603f0 confirms only five changed files (the two pass-5 e2e fixes, ping sweep, its barrier test, and guild-launchpad README). The previously reviewed pass-6 code is otherwise byte-identical.

The original long cursor/batch-wait P2 is addressed in source: the final read is after all cursor and lease-release waits, repeats current lease/expiry/paused/key/scope/member predicates, and builds from freshly read destination/hash. Stale leases are released only after dispatch so that cleanup cannot create another pre-send wait. The real PostgreSQL barrier test exercises nine committed changes plus a no-change control and checks the subsequent destination/renewed-key behavior. Independent exact-source two-row orchestration checks (24 old/new controls with mocked SQL semantics) confirm that an already-prepared first row is excluded when it becomes stale while a later row waits. Signer/SDK/transport probes still pass 10/10. The exact new README also passes the status validator; observed deployment and acceptance fields did not change.

One semantic limit should remain explicit: this is revalidation at dispatch admission, not strict atomic cancellation. A plain SELECT returns an MVCC snapshot; a stop/revoke may commit after that snapshot while its response is returning, before the worker invokes send. A delayed-query-response source probe still produces that single admitted ping. No further application await between read completion and send narrows the window but does not make database state and external HTTP atomic. I am not treating this ordinary already-admitted thin notification window as the original cursor-wait blocker, and this review does not claim a guarantee of zero POST starts after stop commits. A stronger guarantee would require defined dispatch/cancel serialization, not another unlocked SELECT.

Approval remains pending exact-head Verify 43753922221, including the hosted PostgreSQL barrier and full browser/runtime/governance checks. No manual thread resolution or CI rerun performed.

@detna-vibe-coding detna-vibe-coding left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved exact head b487141 against base 0eda90b after the cumulative pass-5/pass-6 source review and fix verification above.

Verify 43753922221 and CodeQL 43753922313 both succeeded. Independently downloaded and digest-verified hosted artifacts bound to candidate 716401c and its exact base/head parents:

  • Runtime 14179420281: 12,155/12,155 tests, 736 files, all eight partitions, cleanup verified; SHA-256 7c6ec75489025addc66ae3900e90cda046a7d602ec96131a2b9e83ea132b1617. agent-change-pings passed all 10 cases including the new real PostgreSQL cursor barrier; the artifact's source manifest matches the reviewed new test bytes (83e46802b29f92b48a8c3f2b156eba36ca9667b5e799665c8bdfb1505e2253cc).
  • Browser 14179079876: 2,797 passed tests over 266 files and six successful profiles; default 2,716 passed / 59 intentional skips, no failed case. SHA-256 86584dca429b2f774534a6e911bd13c7f9fb8855947c5757f4f03dcb05c3f619. Includes share-launcher 12, GitHub setup 8, agent-door 1, and absurd-daily 187 successful tests on THIS candidate.

The original cursor-wait P2 and migration-frontier CI blocker are fixed and verified. Prior review explicitly describes the remaining dispatch-admission/MVCC cancellation semantics; this approval does not assert atomic cancellation of an already-admitted thin ping. No new blocking finding remains. The separate failed #1352 run is not being represented as successful or bypassed; this superseding stacked candidate has its own complete green verification.

No merge, auto-merge enablement, deployment, rerun, or protection change was performed by this review.

@teddashh
teddashh merged commit db3ea70 into main Nov 15, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants