Repository navigation
revamp(pass 5): agent keys save private drafts; new stores show 開店步驟 - #1352
6 commits merged into
Conversation
…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
left a comment
There was a problem hiding this comment.
Reviewed pass 5 at 5267d2b (base 0eda90b). No new blocking source finding in the reviewed changes.
- Traced the six new agent operations from exact registered-route allowlisting through current key/scope checks, owner/community predicates, private-draft-only mutations, and receipt handling. Publish, consent/activation, upload grants and key management remain person-only. Development proposals still reauthorize the current guild/GitHub/grant before replay and recheck authority before returning; late loss rolls back local effects. Agent receipts are separated from browser receipts and from other agent connections.
- Independently ran the existing-source contract consistency probe: 10/10 checks across 51 granted operations, including exact OpenAPI/UI/SDK agreement, denied-route omission, idempotency and If-Match requirements. Exact-source, mocked-port orchestration probes passed 14/14 for receipt isolation/replay/conflict, browser-only denial, post-wait/late key expiry, grant loss, proposal URL target binding and provenance. These are bounded source probes, not a substitute for PostgreSQL/HTTP integration tests.
- Reviewed the store checklist, event first-list/read/retry behavior, admin manage=0 URL persistence, and public return-path change. Independent source probes passed 8/8, including 96 store history/permission combinations, admin filter/detail/legacy URL round-trips, and stale/wrong-event/session/403/404/503 response handling.
CodeQL is successful. Approval remains pending the exact-head Verify run 43748603240 and its hosted runtime/browser evidence; those suites are still running. No CI rerun, thread resolution, merge, deployment, or source change was performed.
detna-vibe-coding
left a comment
There was a problem hiding this comment.
Hosted verification update for unchanged head 5267d2b:
- Runtime matrix passed: 12,135/12,135 tests across 735 files and all 8 partitions, with database cleanup verified. I independently downloaded artifact 14175779575 and matched its ZIP SHA-256 (cd92f58ecc8ce9bdae3927a40fa06e8efb89d1099c63b8783f42f0c7cc294e0f), candidate 3a11f67, and its exact base/head parents.
- ui-default (3), job 132917503673 in Verify 43748603240, failed. Its digest-verified diagnostics contain 682 expected, 13 skipped, 1 unexpected, 0 flaky. The sole unexpected case is
expanded share kinds reach events, services, collaboration, cocreation and drafts without publication, at tests/e2e/share-launcher.spec.ts:228. It expected writes=[] but observed exactly POST/api/v1/social-posts/:id/read. - That test installs a page-wide listener for every POST after login. The test file is byte-identical to base 0eda90b (Git blob f8bb2e6ba2764ddc3d2039c902d7f2419975f6c7). The evidence points to the read-marker request contaminating the no-publication assertion, not an observed content publication. Please make the test distinguish the intended publication/domain mutations from background read tracking while preserving its no-publication guarantee, then obtain a successful exact-head hosted Verify. No blind rerun has been requested.
Approval remains pending this required CI failure; the source review and passed runtime evidence above remain reusable.
detna-vibe-coding
left a comment
There was a problem hiding this comment.
One additional hosted failure is now available in Verify 43748603240: ui-default (2), job 132917503672. Digest-verified artifact 14177150652 (SHA-256 ef52a1bc8a0d3be8fafa513b0e187f43929b444640ff913916677205673c4d34) binds the same base/head/candidate and reports 654 expected, 46 skipped, 1 unexpected, 0 flaky.
The sole failure is tests/e2e/github-setup.spec.ts:138, setup blocks an unexpected external form target and never presents it as successful. The invalid-target alert assertion succeeds, then the test expects /admin?view=github exactly but receives /admin?view=github&manage=0. This matches the new intentional AdminPanel URL serialization (writeManage), rather than evidence of outbound navigation. Please update this URL expectation to the intended current contract while retaining the invalid-target alert, same-origin/location and zero-outbound-request assertions; the latter assertions currently are not reached because the URL assertion throws first.
This is separate from the previously reported UI3 read-marker assertion. Both must be addressed and verified on the next exact-head run. Existing substantive source review and passed runtime evidence remain reusable; no rerun or source edit performed.
…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>
|
Pushed
Local runs, with the pinned Playwright configuration and one worker:
Waiting for the exact-head hosted Verify. |
detna-vibe-coding
left a comment
There was a problem hiding this comment.
Reviewed the two-file test-only delta at b460e4b. Both diagnosed failures are addressed without changing product code: only POST /api/v1/social-posts//read is excluded from the page-wide no-publication collectors; every other POST still counts. Independent evaluation of the exact helper checks 12 mutation paths remain counted, and both collectors use it. The GitHub setup test now pins the exact same-origin manage=0 URL before and after the refused target and retains the invalid-target alert, zero outbound requests, and enabled-button assertions.
No new source blocker. The prior substantive review remains applicable, and the old-head 12,135-test runtime result is not being misrepresented as evidence for this new head. Approval awaits successful exact-head Verify 43753920593 and its hosted evidence; CodeQL is already successful. No source edits or reruns performed.
detna-vibe-coding
left a comment
There was a problem hiding this comment.
Verify 43753920593 has now finished with one new remaining browser failure on b460e4b. The previously reported UI2/3 failures are green, and the new-head runtime matrix passed 12,135/12,135 (735 files, eight partitions, cleanup verified).
ui-default (1), job 132934052488: digest-verified diagnostics artifact 14179861707 (f9561574f616498c14e345b30f8c7c6419e4d236819264fbb9a843c76ab0768f) reports 693 expected, 1 unexpected, 0 skipped/flaky. The sole failure is tests/e2e/absurd-daily.spec.ts:1624, UX-11 touching a real corn dog selects and flips that piece; lifted food moves to the dressing tray with its own sauce: after serving and resuming the browser clock, the real 下載完整成果 PNG link did not appear within the existing 5-second assertion. The earlier touch/portion/sauce assertions passed. Screenshot and trace show the result page still in 正在整理成果圖… / 正在準備分享成果,接著載入立體料理。, with no page-error event in the trace, rather than an explicit failed-image state.
The test is byte-identical to main base (Git blob 16da242926eddefcc3cc2605974945f7e552a35c), and this PR does not change kitchen/result rendering source. This establishes a required-CI failure, not causality to pass 5 or proof of a harmless flake. The adjacent test comments explicitly retain this real five-second download as responsiveness acceptance; please investigate the pending PNG/clock/render boundary and get a successful exact-head Verify rather than simply deleting/widening that guarantee. #1353's same inherited default shard passed, which is a useful comparison but cannot replace this head's failed result.
Approval remains pending this check. No rerun, source change, or protection bypass performed.
|
Follow-up on review 5912856014: the UX-11 PNG wait at This PR's commits reached main through #1353, which was stacked on this PR and merged as What we know
The cause on the hosted runner is still unknown, so I am not claiming one. What changes: nothing in the 5 s assertion. The next PR adds test-only timing:
It prints a |
Five small follow-ups to the platform revamp (#1348), plus two browser-test fixes from this pull request's first Verify run, in one pull request so they need one review and one Verify run.
1. One Agent key also saves private drafts (GAP-13)
A member's own agent (an
fw_agent_key from 自動化 → 我的 Agent) can now do six more things through the existing member routes. Nothing new is public: drafts and proposals stay private to the member, and publishing stays a person's click.skills.drafts/api/v1/me/skill-submissionsskills.draft_read/api/v1/me/skill-submissions/:idskills.draft/api/v1/me/skill-submissions/manualskills.revise/api/v1/me/skill-submissions/:id/manual(needsIf-Match)development.status/api/v1/me/development/:kind/:targetdevelopment.propose/api/v1/me/development/:kind/:target/proposalssharescope, because the token table's scope check allows only read/share/rsvp/react/message; a new scope would need a migration.agent/<connection>/<operation>namespace, the sameIdempotency-Keyreplays, and a different body under the same key returns 409idempotency_conflict.source: 'agent'and the connection id, so a draft saved by an agent is told apart from one typed in the browser.granted: false: publishing, illustration, upgrade, upload keys, and development consent, activation and keys.fw_agent_key that already has thereadorsharescope gets the matching operations above; drafts are private, so this is less than whatsharealready allows. The older upload keys (fpk_/fpg_) and development keys (fpd_), their screens and their endpoints stay as they are, andfw_agent_still cannot use those endpoints.contracts/agent/v1/openapi.json, the MCP tool list and the SDK are regenerated from the allowlist).2. A new store shows 開店步驟 until its first publication (GAP-14)
A member who had just created a store saw four workspace tabs and no hint of what comes next. Until the first publication, the store page shows three steps above the tabs:
✓ 商店資料已建立 → 新增第一件商品 (or ✓ 已新增 N 件商品) → 在「店面與發布」預覽後發布
One 「前往下一步」 button opens the next tab and moves focus to it; it hides when that tab is already open. A member without publish permission reads 請有發布權限的成員預覽後發布 and gets no button. The list uses only data the page already reads, and it does not come back for an owner who unpublished on purpose.
3. Share return paths are rebuilt from constant prefixes
publicShareReturnPath(apps/portal-web/src/modules/PublicDiscovery.tsx) already accepted only/services/<uuid>and/works/<uuid>. It rebuilt the path as/${match[1]}/${match[2]}.js/client-side-unvalidated-url-redirectionalerts on the sign-in page's return to a shared page: App.tsx lines 635, 641 and 706 (alerts 145 and 146, adjudicated in revamp(passes 1-4): five places, guild tools, share credit, agent door, events, build from your own repository #1348)./services/and/works/prefixes, aspublicDiscoveryPathalready does.//host, schemes, uppercase and extra segments.4. A kind filter in 待處理 survives reload and Back
This is review 5910486477's non-blocking P3 on #1348, kept out of #1348 so its last Verify could finish.
view=<kind>with nomanageparameter. On load and on Back, every view other than the three places was read as a management screen, so a reload or Back opened the management screen instead of the filtered inbox.manage=0, a management screen writesmanage=1, and the three place views write neither. On load, on Back and after an admin account change,manage=1opens management andmanage=0does not. A view link with nomanagepredates the places, so it still opens its management screen.admin-placesfilters to 檢舉處理, reloads, opens the item, reloads, goes Back and finds the filtered inbox again;/admin?view=held-sharesstill opens the management screen. On the old code the filter is gone after the first reload.5. An opened event reads its detail once, after the first list read
#events/<id>was read at mount and read again when the first list read landed, because the detail read depends on the list. An unlisted event showed its detail, then loading, then the detail again; a listed one cost a wasted read. Inevent-detail-retry's path entry, a list landing after a failed first read started another read that raced the 重新讀取活動 button. This showed on a slow local database; hosted Verify passed.finallyclears the flag, and a session change remounts the panel). While it waits, the detail region shows 正在載入活動….event-detail-retryhas a new 1280px case. It holds every/guilds/directoryread, sees 正在載入活動… and no detail read after 500 ms, then runs 503, 重新讀取活動 and the event with exactly two detail reads. It fails without the fix.event-route-identityand four other event UI runtime files had built "detail first, list late" races that the fix removes. They now reach the same race through a real path: the first list read fails, the detail opens, and 重試 starts a list read that lands late. No case was removed and no assertion was weakened.6. Two browser checks allow the feed's reads and the admin
manageaddressTest-only. Both failed in Verify 43748603240.
share-launcher.spec.ts: its no-publication checks counted every POST on the page. The 動態 feed records a read for any post that stays half visible for a second (SocialInteractions.tsx), andmobile-install.spec.tsposts earlier in the same shard. On a slow runner the read receipt counted as a write. The two page-wide collectors now skip onlyPOST /api/v1/social-posts/<id>/read. A new check pins that posting, editing, commenting, liking, public sharing and other read receipts are still counted.github-setup.spec.ts: since section 4, the admin menu opens the GitHub setup screen at/admin?view=github&manage=0. The refused-target test now expects that exact same-origin address before and after the refusal, so its zero-outbound-request and button checks run again.Tests
Locally. This branch is rebased onto main after #1348 merged (
0eda90b2b). The rebase only brings in #1348's last fix (fa68f2475, the post share dialog), and the pass-5 changes are byte-identical to the ones checked before on #1348's earlier head.On this rebased branch:
agent-door70,agent-mcp14,agent-contract5,agent-contract-responses3,agent-discovery3,sdk-agent-client6,skill-submissions27,skill-submission-flow8,development-access11,development-map13,canonical-printed-addresses4,hosted-store-next-steps9 (new),hosted-store-areas9,hosted-store-page-state15;surface-audit29,surface-adversarial30,modules14,modules-repository1; the source-boundary check, the consumer-library suites and the media-restore drill;On the earlier base, with the same pass-5 changes:
hosted-store-member-journey,works-public,member-servicesand the five admin specs (admin-places,admin,admin-review-center,community-certification,repo-author-claims). 381 of 382 pass.storefront-offline-checkout's 5 s wait after admitting a store ran out. Run alone, the spec passes 27 / 27. It passed in each of revamp(passes 1-4): five places, guild tools, share credit, agent door, events, build from your own repository #1348's last three Verify runs, and this PR does not touch store readiness.hosted-store-member-journeynow checks the steps, the button, where focus goes, 320 px width, and that the list is gone after publishing and after signing in again.works-publicandmember-servicessign a visitor in and back to/works/<id>or/services/<id>.hosted-store-photopasses 46 / 46 in a scratch copy whose fixture role has a password, because the spec otherwise needs CI's passwordless role;tests/runtime/event*.test.tsfile and every runtime file that importsEventsPanel(59 files) pass; all 21tests/e2e/event*.spec.tsspecs give 166 passed in one run;event-detail-retry.spec.tspassed 9 / 9 in five runs in a row, and in three more after the new case was changed to hold every directory read instead of only the first.b460e4bea: 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, and the new ones pass. Without the pause,mobile-install,share-launcherandgithub-setupgive 27 passed with the pinned configuration, and typecheck passes.The agent-door tests cover the refusals too: a key without the
sharescope gets 403scope_required, publishing through an agent key gets 403, a revoked key gets 401, and a changed body under the sameIdempotency-Keygets 409idempotency_conflict.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.