This repository ("Roboppi" / package name: roboppi) is a Bun + TypeScript (ESM)
codebase that implements an execution-control runtime for agentic workers.
Prefer make targets (CI uses them), but bun equivalents work.
bun install
bun install --frozen-lockfile # CICI currently uses Bun 1.3.8 (see .github/workflows/ci.yml).
There is no ESLint/Prettier/Biome config today; use TypeScript strict checks + tests.
make typecheck
# or
bun run typecheckmake test # bun test
make test-unit # bun test test/unit
make test-integration # bun test test/integration
make test-at # bun test tests/at
make test-branch # bash tests/branch/run-branch-verification.sh
make test-all # CI: typecheck + test + test-branchAcceptance test helper runner:
bash scripts/run-at.sh # typecheck + tests/at
bash scripts/run-at.sh --full # + bun testbun test test/unit/ipc/protocol.test.ts
bun test test/unit/ipc/protocol.test.ts -t "routes submit_job" # regex on test name
bun test -t "routes submit_job" # match across all tests
bun test --only # only test.only/describe.only
bun test --timeout 20000 test/integration # per-test timeout (ms)
bun test --watch test/unit # watch modeBuilds a native executable ./roboppi (gitignored).
make build # or: bun run build
make install # /usr/local/bin/roboppi
make uninstallmake dev # bun run src/cli.ts
bun run dev # bun run src/index.ts
bun run dev:scheduler # bun run src/scheduler/index.ts- Runtime entrypoints:
src/cli.ts(bin),src/index.ts(Core process) - Core safety mechanisms:
src/core/** - IPC JSONL protocol/transport:
src/ipc/** - Daemon entrypoints:
src/daemon/** - Worker adapters + process mgmt:
src/worker/** - Workflow runner/executor:
src/workflow/** - Scheduler layer:
src/scheduler/** - Design notes:
docs/** - Unit/integration tests:
test/** - Acceptance + branch-safety tests:
tests/**
- ESM everywhere (
package.jsonhas"type": "module"). - Relative imports for local modules MUST include the
.jsextension.- Example:
import { AgentCore } from "./core/agentcore.js";
- Example:
- Use
node:specifiers for built-in modules.- Example:
import { readFile } from "node:fs/promises";
- Example:
- Use
import type { ... }for type-only imports. - Avoid the
@/*path alias unless you confirm runtime resolution; prefer relative imports.
- 2-space indentation, semicolons, trailing commas in multiline constructs.
- Keep changes minimal: no repo-wide reformatting sweeps (no formatter is enforced).
- No enforced ordering; keep import groups consistent within the file you touch.
- Keep
import ...statements at the top of the file. - Prefer
../types/index.jsbarrel exports for shared types/enums. - Avoid default exports for local modules; use named exports (existing pattern).
tsconfig.jsonis strict (noUncheckedIndexedAccess,noUnusedLocals/Parameters, etc.).- Avoid
anyinsrc/**.- Use
unknownincatchand narrow viainstanceof Error,typeof, etc.
- Use
- Add explicit return types for exported functions and public class methods.
- Prefer small discriminated unions / string enums for protocol/state machines.
- Files:
kebab-case.ts(e.g.,json-lines-transport.ts). - Classes/types/interfaces/enums:
PascalCase. - Functions/locals:
camelCase. - Constants:
SCREAMING_SNAKE_CASE. - IDs are UUID strings: use
generateId()/crypto.randomUUID().
- Throw
Error(or subclasses), never strings. - Set
err.nameon custom error classes; attachcausewhen useful. - When surfacing errors across boundaries (IPC/worker/workflow), include context:
requestId,jobId,permitId,stepId. - Use
ErrorClassfor retryability when returningWorkerResult-style failures.
- If a function can block (IO, process spawn, long loop), accept an
AbortSignaland stop promptly when aborted. - Always clear timers and remove event listeners in
finallyblocks. - When spawning subprocesses, prefer
ProcessManager(abort, timeout, best-effort process-group termination).
- IPC is JSON Lines over stdout. In server/Core mode, NEVER write non-JSON to stdout (use stderr/loggers).
- Validate message shape before acting (see
src/ipc/protocol.ts).
- Use
bun:test(describe,test/it,expect). - Keep tests deterministic; avoid network and real worker CLIs in unit tests.
- Use temp dirs for filesystem work; clean up after.
- No
.cursor/rules/,.cursorrules, or.github/copilot-instructions.mdfound in this repo.