Repository navigation
docs: add CONTRIBUTING.md + daemon sync-ops rule - #4447
Merged
Merged
Conversation
CONTRIBUTING.md with base guidelines; golden rule #1 is: no synchronous/ blocking work in the sandbox daemon — it runs on a single-threaded Bun event loop, so sync fs/crypto/CPU work blocks the loop, the health probe stops answering, and Studio marks the sandbox dead and tears it down. Also adds the same as gotcha #8 in AGENTS.md (CLAUDE.md).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds contributor guidelines, with the hardest-biting rule front and center.
CONTRIBUTING.md— human-facing quick start (setup, pre-push checks, testing tiers, commit/PR conventions) that points toAGENTS.md/TESTING.mdrather than duplicating them. Golden rule feat: Genesis #1: watch out for synchronous / blocking operations, especially in the sandbox daemon.AGENTS.md(akaCLAUDE.md) gotcha Implement navigation for integration tooltip in agent list component #8 — the same rule, so AI assistants and humans both see it.The rule
The sandbox daemon (
packages/sandbox/daemon/**) runs on a single-threaded Bun event loop. Any sync fs / crypto / CPU-bound work blocks the loop → the daemon stops answering its HTTP health probe → Studio, which polls that probe, concludes the sandbox is dead and tears it down / triggers recovery. A single missed probe can flip a healthy sandbox to "crashed", so a straywriteFileSynccan kill a live user session. Usenode:fs/promises,await, stream/chunk large payloads, offload CPU work.Direct motivation: the tool-catalog sync in the sandbox PR originally used
writeFileSync; caught and moved tofs/promises. This writes the lesson down.Testing
Docs only — no code paths. Linked files (
TESTING.md,LICENSE.md,AGENTS.md) verified to exist;bun run fmtclean.Summary by cubic
Adds
CONTRIBUTING.mdwith a quick start, issue/PR/branch basics, and the highest-impact rules (tools viaStudioContext, use@decocms/stdfor async, don’t silence lints, and never block the event loop—especially inpackages/sandbox/daemon/**). Also documents pre-push checks, unit vs e2e test tiers, conventional commits, and adds the same daemon sync/blocking rule toAGENTS.md(gotcha #8) to prevent false “dead” health probes.Written for commit 221ff12. Summary will update on new commits.