Skip to content

docs: add CONTRIBUTING.md + daemon sync-ops rule - #4447

Merged
pedrofrxncx merged 2 commits into
mainfrom
docs/contributing-guidelines
Jul 11, 2026
Merged

pedrofrxncx merged 2 commits into
mainfrom
docs/contributing-guidelines

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jul 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds contributor guidelines, with the hardest-biting rule front and center.

  • New CONTRIBUTING.md — human-facing quick start (setup, pre-push checks, testing tiers, commit/PR conventions) that points to AGENTS.md/TESTING.md rather than duplicating them. Golden rule feat: Genesis #1: watch out for synchronous / blocking operations, especially in the sandbox daemon.
  • AGENTS.md (aka CLAUDE.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 stray writeFileSync can kill a live user session. Use node: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 to fs/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 fmt clean.


Summary by cubic

Adds CONTRIBUTING.md with a quick start, issue/PR/branch basics, and the highest-impact rules (tools via StudioContext, use @decocms/std for async, don’t silence lints, and never block the event loop—especially in packages/sandbox/daemon/**). Also documents pre-push checks, unit vs e2e test tiers, conventional commits, and adds the same daemon sync/blocking rule to AGENTS.md (gotcha #8) to prevent false “dead” health probes.

Written for commit 221ff12. Summary will update on new commits.

Review in cubic

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).
@pedrofrxncx
pedrofrxncx merged commit 72d5337 into main Jul 11, 2026
14 checks passed
@pedrofrxncx
pedrofrxncx deleted the docs/contributing-guidelines branch July 11, 2026 00:43
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