Skip to content

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

Merged
earakely-scale merged 9 commits into
mainfrom
wloo/website-notes-example
Nov 6, 2026
Merged

earakely-scale merged 9 commits into
mainfrom
wloo/website-notes-example

Conversation

@williamloo-scale

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

Copy link
Copy Markdown
Contributor

packages/agentenv-protocol/examples/website/notes/: a reference site on WebsiteEnvironment, about 210 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 site keeps its own users and notes, starting from data/seed.json, behind one lock, and serves them through @reset_data, @add_data and @get_data; acting_user() names the seed's current_user. It is ready only through website/v1's ready (@ready_check seeded).
  • The page uses relative URLs, so it works under the gateway's /website/notes/ route; opened without its final slash, or at its index.html, it reloads at its folder's address. 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, built with the Notes folder as its context: a node stage builds the page, a python stage installs the released agentenv-framework-protocol (0.1.466 or later) and serves the page and API on PORT, with curl for the compose health check. env.toml declares it as the server image, so the folder registers as a bundle's envs/notes/.

Note

Test

  • test_website_notes_example.py: 9 passed, including the built-page test under the gateway's prefix, which CI skips without a Vite build. Protocol website tests: 205 passed.
  • The image, built from the Notes folder alone: healthy, and python -m agentenv_protocol.website.conformance http://localhost:18429 --clock-host host.docker.internal passed 8/8.
  • Headless Chrome against the image: signed in as ann, add, mark done, edit on blur, an unsaved edit and its caret kept through a refresh, filters, switching to ben, a reload keeping ben, delete, a blank title's error; and opened at /index.html. Behind a /website/notes prefix: /website/notes, /website/notes/ and /website/notes/index.html all land at /website/notes/ with the notes.
  • agent-env bundle register <bundle> --dry-run with Notes as envs/notes/: the env and its Dockerfile image resolve.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The latest changes appear safe to merge.

Summary

Adds a reference Notes site with per-user notes, saved drafts, universe time, and data hooks.

  • The Notes site serves each user's notes and an admin-wide view.
  • The Notes page keeps edits usable while it refreshes the list.
  • The Notes example builds and runs as one website server image.

Reviews (19) · Last reviewed commit: "fix(website): the Notes image builds fro..." · Reviewed by Greptile

@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 force-pushed the wloo/website-notes-example branch from d76be33 to a68ff2a Compare November 3, 2026 21:50
@williamloo-scale
williamloo-scale force-pushed the wloo/website-environment-sdk branch from 3579c2a to 76145d2 Compare November 3, 2026 21:50
@williamloo-scale
williamloo-scale force-pushed the wloo/website-notes-example branch from a68ff2a to f1a665a Compare November 3, 2026 22:52
@williamloo-scale
williamloo-scale force-pushed the wloo/website-notes-example branch 2 times, most recently from 30113cb to d43c767 Compare November 4, 2026 03:56
@williamloo-scale
williamloo-scale force-pushed the wloo/website-environment-sdk branch from 05da818 to 33ad3b8 Compare November 4, 2026 03:56
@williamloo-scale
williamloo-scale force-pushed the wloo/website-notes-example branch from d43c767 to b055f91 Compare November 4, 2026 04:37
@williamloo-scale

Copy link
Copy Markdown
Contributor Author

@greptile-apps the three findings from the last review are fixed in b055f91:

  • Filters discard failed edits (main.js): unsaved edits now live in a drafts map keyed by note and field, not only in the inputs. Each render rebuilds a note's fields from its draft, so an edit whose PATCH failed survives a filter that hides the note. A successful save clears the fields it sent.
  • Notes links can leave (index.html): the trailing-slash reload builds its address from new URL(location.href) and changes only pathname, so it can't leave the page's origin. //evil.example/page reloads on the same host. The new-site template in feat(website): the browser client, env website new and env website dev (FD-4683) #446 gets the same line.
  • Saved titles keep saving (main.js): a render restores only the focused field's focus and selection, and takes each value from the note or its draft. Once a save succeeds, the server's trimmed title is shown and isn't sent again. An edit typed after the submission is kept.

Each fix was checked in a browser against a built Notes site: with a failing PATCH, against //evil.example/page and /%2F%2Fevil.example/page, and against a padded title. The full unit suite passes on this commit (12,915) and lint is clean. All three threads are replied to and resolved.

@greptile-apps

greptile-apps Bot commented Nov 4, 2026

Copy link
Copy Markdown

Confirmed: the changes in b055f918 address all three findings. Failed edits remain in drafts across filter renders, the trailing-slash redirect retains the current origin, and accepted saves clear only the submitted draft values so server-normalized titles display without losing newer edits. The reported browser and test checks are consistent with the updated flow.

@earakely-scale
earakely-scale force-pushed the wloo/website-environment-sdk branch from 6150bf6 to e44af7e Compare November 5, 2026 00:05
Base automatically changed from wloo/website-environment-sdk to main November 5, 2026 05:59
earakely-scale pushed a commit that referenced this pull request Nov 5, 2026
…gers by route (FD-4683)

This PR's change, rebased as one commit onto #429.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale and others added 3 commits November 5, 2026 14:52
…ses the conformance check (FD-4683)

This PR's change, rebased as one commit onto #428.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s, and adds a note once per submit (FD-4683)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…sign-in fails, and reloads itself at its slash-ending address (FD-4683)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale and others added 3 commits November 5, 2026 14:52
…hrough data/get, not /go (FD-4683)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s, settles a save the server accepted, and reloads itself on its own origin (FD-4683)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…through website/v1's ready alone (FD-4683)

The SDK on main keeps no store and serves no health path, so Notes holds its users and notes itself, starting from
data/seed.json, serves them through @reset_data, @add_data and @get_data, and names its acting user with
acting_user(). Its readiness is website/v1's ready (@ready_check seeded); env.toml and the image's health check no
longer name /healthz, which the compose health check now reads as the card.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale and others added 3 commits November 5, 2026 15:06
…oncurrent writes keep every note (FD-4683)

Plain def handlers run in worker threads, so two creates could choose one id, and a create could append to a list a
delete was replacing. Every read and write of the site's data is under one lock, ids chosen and notes inserted
together, and the handlers answer copies.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…folder's address (FD-4683)

Opened at /index.html or /website/notes/index.html, the page appended a slash to the file's own path, so its relative
assets were asked for under /index.html/assets/ and the page stayed blank.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…toml registers as a bundle (FD-4683)

A bundle builds an env's image with the env's folder as its context, but the Notes Dockerfile copied the protocol from
the repo root. It now installs the released agentenv-framework-protocol (0.1.466 or later, which has everything Notes
uses), so env.toml, bundle register and env website put all build it from this folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit 145b436 into main Nov 6, 2026
36 checks passed
@earakely-scale
earakely-scale deleted the wloo/website-notes-example branch November 6, 2026 00:26
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