GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(server): experimental spaces by kommander · Pull Request #63998 · anomalyco/opencode Conversation
|
| if (!spaces || !requests?.length) return live | ||
| // Read only after registering: a change committed meanwhile is then in the initial state, the queue or both, | ||
| // and never missed. Writers do not wait for this. | ||
| const initial = yield* Stream.fromIterable(requests).pipe( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stream.runCollect reads every batch of every requested space into memory before the first frame goes out. So the 500-row batching splits events but doesn't limit memory or delay. Also, with values up to 1 MiB, a single 500-row batch can be one frame of hundreds of MiB.
Since live is only pulled after the initial stream has finished, you could stream the batches lazily and update revisions as each item is emitted (e.g. Stream.tap) instead of collecting first. Capping batches by bytes as well as by rows would also keep the frame size bounded.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
30b4ada to
f1f557b
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This push is a rebase onto current dev; the spaces code is unchanged. The spaces tests and tsc -b still pass in packages/server. The open point about catch-up reading every batch into memory with Stream.runCollect before sending isn't addressed yet. The public API impact is the same as in the previous review: experimental additions only, backwards compatible.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
f1f557b to
07d65d3
Compare
MASTER PROMPT: Create a Complete Cinematic Documentary Using AI1. Video ConceptEpisode Title: Why Does Time Feel Like It's Moving Faster, Even Though the Clock Hasn't Changed? Central Question: Why do we feel that time passes faster as we grow older, even though a minute is still exactly sixty seconds? The documentary should explore how human perception of time changes with age, and how memory, daily routines, modern technology, attention, and the brain's processing of experiences influence our sense of time passing. The goal is to make viewers question an everyday experience they constantly have but may never have deeply examined. 2. Video Specifications
The final result must feel like a carefully researched, professionally produced documentary, not a slideshow with narration, a generic motivational video, or a random collection of AI-generated clips. Essential requirement: Every human character appearing in the video must be an adult. Children and teenagers must not appear in any scene. 3. Storytelling ApproachBuild the documentary around one central question and gradually reveal different layers of its answer. Begin with a personal mystery that most people can relate to. Then explore history and science, connect the explanations to everyday life, and finish with a thoughtful reflection that stays with the viewer after the video ends. Use storytelling, visual metaphors, historical reconstructions, scientific explanations, and philosophical questions. Do not imitate the distinctive style, scripts, visual identity, or presentation of any existing content creator. Develop an original visual and narrative identity for this channel. 4. Detailed Scene StructureScene 1: The Mystery of Time | 0:00–1:00Begin with a black screen and the quiet ticking of an old clock. Show an extreme close-up of the clock hands moving. Transition to an adult man looking through an old photo album in a warmly lit room, followed by an adult woman standing beside a window, reflecting on different stages of her life. Show cinematic details such as sunlight entering through the window, dust floating in the light beams, old photographs, a quiet street, and adult people enjoying different moments in their lives. Then transition to an adult man sitting on a modern bus, watching buildings and cars pass outside the window. Make the city feel fast, crowded, and repetitive, while the man appears lost in thought. The Arabic voice-over should ask: "بتتذكر كيف كانت العطلة الصيفية تحسّها طويلة بشكل غريب؟ وكيف كان اليوم الواحد مليان أحداث؟ طيب، ليش هلأ أحياناً بيخلص الأسبوع وكأنّه ما صار شي؟ هل الوقت فعلاً صار أسرع، ولا نحنا اللي تغيّر فينا شي؟" End the scene with a close-up of an adult man looking at a wall clock. Scene 2: How Did Humans Begin Measuring Time? | 1:00–3:00Reconstruct historical scenes of ancient civilizations observing the sun and shadows to understand the passage of time. Show an ancient sundial, a water clock, candle clocks, medieval mechanical clocks, and a large historical clock tower. Use architecture, clothing, tools, and materials appropriate to each historical period. Make transitions between historical eras smooth and visually connected. Show adult craftsmen carefully assembling ancient clock mechanisms. Focus on metal gears, pendulums, clock hands, and moving mechanical components. The narration should explain how humans gradually developed increasingly precise ways to measure time, while clearly distinguishing historical facts from artistic reconstructions. Do not invent dates, quotations, or unsupported historical information. Scene 3: The Industrial Revolution and Humanity's Relationship with the Clock | 3:00–4:30Show the transformation from quiet rural life to industrial cities. Reconstruct nineteenth-century factories, steam trains, adult workers arriving at their workplaces at specific times, mechanical production lines, and clocks displayed in public spaces. Use visually contrasting scenes: An adult farmer working outdoors and following the sunlight, followed by an adult factory worker checking a wall clock. Show a train departing from a station, large railway clocks, and adults walking quickly through busy city streets. Explain how the Industrial Revolution increased the importance of punctuality, timetables, and standardized time. Do not claim that humans had no systems for organizing schedules or appointments before industrialization. The visual contrast should communicate how clocks became an increasingly central part of modern life. Scene 4: The Difference Between Clock Time and Human Perception of Time | 4:30–6:30Transition to the modern world. Show an adult person waiting for an appointment in a public place, looking at a clock, tapping their fingers nervously, and checking their phone. Contrast this with another adult who is completely absorbed in an activity they enjoy, such as painting, playing music, or exploring a beautiful natural landscape. Use two different visual rhythms: Slow, static shots during waiting and boredom, and more fluid, immersive shots during enjoyable activities. Explain the difference between objective time measured by clocks and subjective time experienced by humans. Use an elegant scientific animation showing a clock advancing steadily while a person's perception of time changes according to attention and emotional state. Explain that boredom, stress, attention, and engagement can influence how people experience time, but there is no single explanation that applies to everyone. Scene 5: Memory, New Experiences, and Growing Older | 6:30–9:00Show an adult visiting an unfamiliar place for the first time, such as a large museum, a lake, a forest, or an art exhibition. Focus on expressions of curiosity, discovery, and attention to detail. Transition to another adult living through a familiar daily routine: commuting along the same route, sitting at the same desk, and walking through the same streets every day. Represent memories visually through photographs, diary pages, old family videos, and meaningful moments from life. Create a symbolic scene in which a calendar fills with similar-looking days, then contrast it with a collection of distinctive and memorable experiences. Carefully explain that the duration of a period as experienced in the moment may differ from how long it seems when remembered later. Novel and distinctive experiences may create richer and more varied memories, but this does not prove that novelty alone explains why time seems to accelerate as people grow older. Avoid presenting simplistic explanations as complete scientific facts, such as claiming that a year feels shorter simply because it represents a smaller percentage of a person's life. Scene 6: The Repetitive Rhythm of Modern Life | 9:00–11:00Show an adult waking up in the morning, checking phone notifications, commuting to work, working at a computer, eating, scrolling through their phone, and eventually going to sleep. Repeat certain visual compositions deliberately to create a sense of routine and repetition. Use window reflections, crowded streets, elevator doors, traffic lights, and a digital clock changing from morning to evening. Introduce phone notifications and fast digital content as visual elements. However, do not claim that technology literally makes physical time pass faster. Explain that distraction, multitasking, stress, routine, and the way we remember events may all contribute to the feeling that days and weeks are disappearing quickly. Use balanced editing and natural ambient sounds. Avoid making the scenes look like advertisements for a phone or technology company. Scene 7: Can We Experience Our Days Differently? | 11:00–13:00Gradually transition from the cold lighting of the city to warmer, more natural colors. Show adults participating in different activities:
Add small cinematic details such as raindrops on a window, sunlight slowly moving across a wall, steam rising from a cup of coffee, and leaves moving in the breeze. Explain that paying attention to the present moment, introducing meaningful variety into life, and creating memorable experiences may help people feel more connected to their days. Do not promise viewers that these practices will scientifically slow down time or produce identical results for everyone. The atmosphere should become more hopeful while remaining intellectual and realistic. Scene 8: The Final Reflection | 13:00–14:30Return to the old clock shown at the beginning of the documentary. Show the same street from two different perspectives, focusing on an adult remembering the past and looking at the place with a different perspective. Show an adult standing quietly in a city square while the world continues moving quickly around them. Gradually lower the music and allow natural ambient sounds to become more noticeable. End with a close-up of sunlight on a wall, a softly ticking clock, or an adult looking through a window at the evening sky. The narration should leave the viewer with a deep question rather than an exaggerated motivational speech. Use the following Arabic narration: "يمكن المشكلة مو إنّ الوقت صار يركض… يمكن إنّنا أحياناً منمرق بأيامنا من دون ما ننتبه إلها. الساعة رح تضلّ تقيس الدقائق بالطريقة نفسها، بس علاقتنا بهالدقائق ممكن تتغيّر. والسؤال مو بس: قديش ضلّ من الوقت؟ السؤال كمان: قديش من الوقت اللي عشته كنت حاضر فيه فعلاً؟" Leave a short moment of silence, then gradually fade to black. 5. Visual DirectionEvery scene must look cinematic and serve a clear purpose in the story. Use the following visual elements:
Avoid:
Add accurate Arabic labels and explanatory graphics during post-production. 6. Voice-over and Sound DesignGenerate a natural Arabic voice-over with clear pronunciation, a calm documentary delivery, subtle emotion, and varied pacing according to the scene. The voice should sound curious and thoughtful, not robotic, theatrical, or excessively dramatic. Use:
Keep the background music consistently lower in volume than the narration. Use only original, licensed, or commercially cleared music and sound effects. 7. Scientific and Historical AccuracyBefore completing the documentary, verify all scientific and historical information using reliable sources. Prioritize:
Do not invent studies, researcher names, statistics, quotations, or historical events. Do not present visual metaphors as scientific evidence. Clearly distinguish established scientific findings from hypotheses, simplified explanations, and questions that remain under investigation. Prepare a list of all sources used, including links and sufficient identifying information. Never fabricate sources or research links. 8. AI Production WorkflowProduce the video using short, individually controlled shots rather than attempting to generate one continuous 15-minute video in a single operation. For every shot, create the following:
Maintain consistent character appearances, clothing, locations, and color palettes whenever the same characters appear in multiple scenes. Assemble all shots into one coherent timeline. Generate the voice-over separately and synchronize it with the visuals. Add Arabic subtitles and verified explanatory text during post-production. Balance the audio and background music, then export the final video. If the AI platform cannot generate the entire documentary in one operation, divide the production into organized scenes and manageable sections. Do not silently shorten the documentary or remove essential sections. 9. Required Final DeliverablesProduce the following:
The documentary must be intelligent, visually rich, emotionally relatable, scientifically responsible, and built around an original visual and narrative identity. FINAL MANDATORY REQUIREMENT: Every human character appearing in every shot must be an adult. Do not include children or teenagers in historical reconstructions, modern scenes, symbolic scenes, or any other part of the documentary. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Re-checked on the new head against a live server: /api/experimental/space/... writes, plus snapshot, delta and live experimental.space.* events on /api/event?experimental.space=.... The server, core and client tests and tsc -b in packages/server pass. Moving the spaces logic into the EventFeed.Extension hook keeps the event feed generic. Changes that arrive during catch-up are queued until the read finishes and then sent after the catch-up, so revision order still holds.
The earlier point about catch-up being read whole into memory is not addressed yet: Stream.runCollect moved from event-feed.ts into SpaceStore.extension but still buffers every batch before the first event goes out.
Public API: compared with dev, everything is still a new experimental addition and backwards compatible. Compared with the previous head, these were renamed:
/api/experimental/kv/:space/:key → /api/experimental/space/:space/:key/api/event query param experimental.kv → experimental.spaceexperimental.kv.{snapshot,delta,updated,deleted} → experimental.space.*experimental.kv.set/delete → experimental.space.set/delete
Sorry, something went wrong.
There was an error while loading. Please reload this page.
07d65d3 to
288ec07
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The new epoch storage works: I restarted a server built from this head on the same database, and the epoch persisted, so an existing cursor got a delta rather than a snapshot. The server and core spaces tests and tsc -b in packages/server pass.
The earlier point about catch-up being read whole into memory (Stream.runCollect in SpaceStore.extension) is not addressed yet.
New: a failed extension is now dropped silently from the stream (see the inline comment). The public API is unchanged since the last review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| (queue) => | ||
| Effect.sync(() => subscribers.delete(queue)).pipe(Effect.andThen(Queue.shutdown(queue)), Effect.asVoid), | ||
| ) | ||
| // An extension never fails the stream: an event it cannot encode is dropped, and a failed `open` only loses |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
For spaces, I think quietly dropping the extension is the wrong default. Everything under Space.changes / Space.head uses orDie, so a database error during open becomes a defect. That defect is caught here, and the client then gets server.connected and nothing else for its spaces: no snapshot, no error. It will keep showing stale state until it happens to reconnect. The same goes for an event dropped in send: that client misses a revision for good, which breaks the "nothing missed" promise.
Failing the subscriber instead, as offer already does on overflow, would make the client reconnect and resync. Alternatively, the extension could decide whether its errors are fatal.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
288ec07 to
98d8abe
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The new reset endpoint works: on a server built from this head, after POST /api/experimental/space/reset an old cursor got a snapshot with a new epoch. The server and client tests and tsc -b in packages/server pass.
The earlier points about catch-up being read whole into memory and about failed extensions being dropped silently are not addressed yet.
Public API: this push adds POST /api/experimental/space/reset (experimental.space.reset) to the server and the client SDK. It's experimental and backwards compatible.
New: the reset leaves a window after a restore in which clients can get a silently wrong delta (see the inline comment).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| "Remove a stored value and tell the space's subscribers. Removing an unset key succeeds.", | ||
| ), | ||
| ), | ||
| HttpApiEndpoint.post("space.reset", "/api/experimental/space/reset", { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The epoch is stored in the database, so restoring a backup brings back the old epoch along with the old rows. This endpoint can only be called once the restored server is already serving. Any client that reconnects before then, with a cursor at or below the restored highest revision, passes the since <= head check and gets a delta. That delta is silently wrong, because the revisions after that point were lost or are being reissued to different writes. The check only catches cursors that are ahead of head.
To close that window, the epoch would need to change before the first subscriber is served: for example a CLI or offline step, or a flag or env var read at startup, rather than an HTTP call against a live server. If it stays as an endpoint, please at least document that writes and subscribers must be blocked until it has been called.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
98d8abe to
c88e207
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The new flag works: on a server built from this head, experimental.spaces: false makes writes return 403, and with the flag on (the dev default) writes succeed and the stream sends a snapshot. The server tests and tsc -b in packages/server pass.
The earlier points about catch-up being read whole into memory, failed extensions being dropped silently, and the HTTP-only epoch reset are not addressed yet.
Public API in this push: adds the spaces flag (experimental.spaces / OPENCODE_FLAGS); the set, delete and reset space routes now return ForbiddenError (403) when it is off, and the event stream then ignores experimental.space. All experimental and backwards compatible.
New: the flag check duplicates the one used for machines (see the inline comment).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| import { EventFeed } from "./event-feed" | ||
|
|
||
| /** Whether the `spaces` flag is on in the server's base configuration: spaces are server-wide, not per location. */ | ||
| export const enabled = Effect.gen(function* () { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is a line-for-line copy of machinesEnabled in handlers/machine.ts, with only the flag name changed. A shared helper, e.g. serverFlag("spaces"), would keep the two server-wide flag reads from drifting apart, for example if the base-config location or the fallback changes later.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
c88e207 to
f858fb7
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This push is a rebase onto newer dev; the PR's own changes are unchanged. The server spaces tests and tsc -b in packages/server still pass. The four open points (catch-up buffered in memory, failed extensions dropped silently, the HTTP-only epoch reset, and the duplicated flag check) are not addressed yet. Public API impact is the same as in the previous review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
f858fb7 to
700151a
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The new tombstone cap holds up. The floor is read after the delta's rows, so a purge happening at the same time can only cause an extra snapshot, never a delta with missing deletions. Keys rewritten or deleted while a snapshot is paging are picked up by the delta that follows it. The server and core spaces tests (including the new floor and race tests) and tsc -b in packages/server and packages/core pass.
The four earlier points (catch-up buffered in memory, failed extensions dropped silently, the HTTP-only epoch reset, and the duplicated flag check) are not addressed yet. No public API change in this push.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
700151a to
3bdcd20
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The new purge schedule holds up. Deletes are a single statement again, and the purge runs on the first delete in a space after start and then every 64th. It runs while the space's lock is held, before subscribers are told about the delete, and a failed purge is logged without blocking that notification. The floor is still read after a delta's rows, so a concurrent purge can only cause an extra snapshot. The server and core spaces tests and tsc -b in packages/server and packages/core pass.
The four earlier points (catch-up buffered in memory, failed extensions dropped silently, the HTTP-only epoch reset, and the duplicated flag check) are not addressed yet. No public API change in this push.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
02028a3 to
e8ac964
Compare
e8ac964 to
86c4ab6
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.