Skip to content

feat(website): a Notes site on WebsiteEnvironment, one image that passes the conformance check (FD-4683) - #429

Open
williamloo-scale wants to merge 13 commits into
wloo/website-environment-sdkfrom
wloo/website-notes-example
Open

williamloo-scale wants to merge 13 commits into
wloo/website-environment-sdkfrom
wloo/website-notes-example

Conversation

@williamloo-scale

@williamloo-scale williamloo-scale commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #428.

packages/agentenv-protocol/examples/website/notes/: a reference site on WebsiteEnvironment, about 130 lines of Python plus a small Vite page.

  • Per-user notes stamped with self.now(), auto sign-in as the acting user, and /api/admin/notes with roles=["admin"] (403 otherwise).
  • The page uses relative URLs, so it works under the gateway's /website/notes/ route. A refresh keeps text typed into a note that isn't saved yet, with its focus and cursor, and the page's clock re-reads X-Universe-Now every 5 seconds, so a stopped or faster universe clock shows.
  • One image: a node stage builds the page, a python stage serves it with the API on PORT, with curl for the compose health check. env.toml declares it as the server image.

Test

Unit suite and protocol tests: 12,667 passed, lint clean.

  • test_website_notes_example.py: 8 passed.
  • Built and ran the image: healthy, and python -m agentenv_protocol.website.conformance http://localhost:18080 --clock-host host.docker.internal passed 8/8. Pages, session, notes and the admin route checked by curl.
  • In Chromium against the site: with a title's save delayed, text typed into the body stays focused through the refresh and is saved, one save per edit.
  • Registered with agent-env env website put --server-dockerfile ... --health-path /healthz against local stores only.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge with the checked queued-edit fixes supplied by PR #444.

Summary

Adds a Notes reference site on WebsiteEnvironment, with per-user notes, an admin-only route, a Vite page, and one server image.

  • Notes users can manage their own notes, while admins can list them all.
  • The Notes page keeps typing through refreshes and follows the universe clock.
  • The Notes page and server build into one website image.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Browser[Notes page] -->|Relative API calls| Site[Notes server]
  Site -->|Owner checks| Store[Per-user notes]
  Admin[Caller with admin role key] -->|Admin route| Site
  Data[Data plane] -->|Load, export, reset| Store
Loading

Reviews (4) · Last reviewed commit: "Merge wloo/website-environment-sdk into ..." · Reviewed by Greptile

…ses the conformance check (FD-4683)

Per-user notes stamped by the universe clock, an admin-only route, and a Vite page that uses relative URLs so it works
under the gateway's /website/notes/ route. The image builds the page and serves it with the API on PORT, and env.toml
declares it as the env's server image.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@socket-security

socket-security Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​vite@​5.4.1091508397100

View full report

@socket-security

socket-security Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Priority Alert  (click "▶" to expand/collapse) Action
Low priority
High CVE: launch-editor: fs.existsSync() existence check can be bypassed on Windows in npm `vite`

CVE: GHSA-587h-7wmj-h5pm launch-editor: fs.existsSync() existence check can be bypassed on Windows (HIGH)

Affected versions: >= 8.3.0 < 8.3.3; >= 8.2.0 < 8.2.4; >= 8.0.0 < 8.1.6; >= 7.0.0 < 7.3.7; < 6.4.4

Patched version: 6.4.4

From: packages/agentenv-protocol/examples/website/notes/web/package-lock.json → npm/vite@5.4.10

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/vite@5.4.10. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

@williamloo-scale
williamloo-scale marked this pull request as ready for review November 2, 2026 23:27
@williamloo-scale
williamloo-scale requested a review from a team as a code owner November 2, 2026 23:27
williamloo-scale and others added 2 commits November 2, 2026 15:34
… its clock follows the universe's rate (FD-4683)

A refresh after a save replaced the list, so text typed into another
field before the save answered was lost. render() now keeps each field
edited since it was drawn, or focused, and puts back its text, focus
and selection; a field saves on blur too, once per text. The page's
clock assumed real-time speed between answers; it now reads
X-Universe-Now from the health path every 5 seconds, so a stopped or
faster clock shows.

Checked in Chromium against the site: with the title's save delayed,
text typed into the body stays focused through the refresh and is
saved; one save per edit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale and others added 4 commits November 2, 2026 16:33
… they still hold what was sent (FD-4683)

Text typed into the Add note form while the earlier save was pending
was wiped when that save answered, since the form was reset. Each
field is now cleared only when it still holds the text that was
submitted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ck reads (FD-4683)

The page re-reads X-Universe-Now from healthz every 5 seconds, but
npm run dev forwarded only /api, so an idle page under Vite never saw
the site's clock.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale and others added 2 commits November 2, 2026 17:49
… shows the newest filter (FD-4683)

Each note keeps one PATCH in flight and sends its latest text next, so an
earlier save can no longer land after a newer one. render() drops a list
answer when a newer list request has started since.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant