Branching and Development Workflow
This document is for contributors and maintainers participating in Serpent development. It explains the repository's long-lived branching architecture, external contribution workflow, and internal maintainer practices.
1. Branch Roles: main and dev
| Branch | Purpose | What belongs there | Access and releases |
|---|---|---|---|
main | Release baseline and public branch | Stable code, automated tests, runtime resources, public documentation (including docs/developer/), and build configuration | Default public branch, release packaging baseline |
dev | Daily development integration branch | Everything in main, plus internal tickets (.beads/), development logs, and slice designs (docs/internal/) | Target branch for feature development and PR integration |
mainis designed to be "ready to release, stable, and transparently public", delivered to users and the open-source community with releases;devsupports active development and historical development evidence;- All external Pull Requests must target
dev.
2. External Contributor Workflow (GitHub Collaboration)
The recommended workflow for external developers participating in Serpent:
2.1 Preparation
- Fork the dolag233/Serpent repository on GitHub;
- Clone your forked repository to your local development environment (do not place it on SMB/NAS network shares):
git clone https://github.com/<your-username>/Serpent.gitcd Serpent
- Follow the Setup Guide to configure Node.js 24 and dependencies:
npm ci --registry=https://registry.npmjs.orgnpm run rebuild:native
- Check out the latest
devbranch and create your feature or bugfix branch:git checkout devgit pull origin devgit checkout -b feature/my-feature-name
2.2 Development and Quality Gates
When making changes, adhere to these engineering principles:
- Type safety and code style: Pass static TypeScript type checking and ESLint before committing:
npm run typechecknpm run lint
- Test coverage:
- Add unit tests for pure logic to
tests/unit/; - Add tests for Worker or SQLite operations to
tests/worker/; - Run targeted tests to verify your changes:
npm run test:unit -- tests/unit/<your-test-file>.test.ts
- If changes touch library opening, database migrations, or underlying filesystem operations, pass the library availability suite:
npm run test:library-availability
- Add unit tests for pure logic to
- Workspace cleanliness and privacy sanitization:
- Committed files must never contain local absolute paths, personal usernames, drive letters, private credentials, or temporary test media;
- Test artifacts must be created in temporary directories and cleaned up when tests complete.
2.3 Commit Message Conventions (Conventional Commits)
Commit messages should clearly state the intent and scope of the change using standard conventions:
<type>(<scope>): <short description>
typecommon categories:feat: New user-facing feature or interaction;fix: Bug fix;docs: Documentation only;test: Adding or fixing tests;refactor: Code change that neither fixes a bug nor adds a feature;chore: Tooling, build pipeline, or dependency updates.
scopeoptional modules:canvas,viewer,library,worker,mcp,plugin,shell, etc.
Examples:
git commit -m "fix(viewer): autoplay video smoothly after navigation"
git commit -m "feat(canvas): add hover scrub position preview"
2.4 Pull Requests and Code Review
For detailed step-by-step instructions, quality gate requirements, and environment setup, see the Contributing Guide.
- Push your local branch to your fork on GitHub:
git push origin feature/my-feature-name
- Open a Pull Request on GitHub, ensuring the Base branch is
dev; - Clearly state the purpose of the change, affected scope, and local test evidence in the PR description;
- Maintainers will review the PR, request any necessary adjustments, and merge it into
dev; - Merged contributions will be acknowledged in
CONTRIBUTORS.mdin the root directory.
3. Core Maintainer Workflow (Internal Engineering & Release Discipline)
This section applies to core maintainers and contributors with repository write permissions, outlining ticket tracking and release merging disciplines.
3.1 Internal Ticket Tracking (.beads/)
The core team tracks daily tasks on the dev branch using lightweight plain-text tickets:
# View ready tasks
node scripts/ticket.mjs ready --json
# Claim a ticket
node scripts/ticket.mjs claim <issue-id>
# Close a completed ticket
node scripts/ticket.mjs status <issue-id> closed --reason "Resolution description, with commit hash"
Note: Ticket data is stored in .beads/issues.jsonl and versioned directly with Git.
3.2 Internal Slices and Design Docs (docs/internal/)
Major vertical slice developments maintain technical specifications, development logs, and code review records in docs/internal/. These process artifacts remain on the dev branch to trace architectural evolution.
3.3 Release Merging and Public Branch Stripping
When features on dev reach the release milestone and need to be merged into main, the following rules apply:
- Single merge commit stripping internal files:
- Internal development files (including
AGENTS.md,CLAUDE.md,docs/internal/,.beads/,.github/, etc.) belong only ondevand must never pollute the publicmainbaseline; docs/developer/is public developer and contributor documentation and must remain onmain;- Merging is done in a single commit: stripping internal files while merging from
devtomain, preventing "add-then-remove" commit churn on the public branch.
- Internal development files (including
- Packaging and building must be performed on
dev:- The packaging pipeline enforces comprehensive verification gates; formal release artifacts are generated on
devvianpm run release:local; - Run
npm run rebuild:nativeafter packaging to restore the native dev environment.
- The packaging pipeline enforces comprehensive verification gates; formal release artifacts are generated on