Repository navigation
how to contribute debugging
This page lists common root / golden-path failure modes. Use pnpm doctor and pnpm status. Capsule failures (Kediri Payload, SentraBot worker, Avery Hermes) are diagnosed from that capsule's docs/testing.md.
- Document recurring errors: PostgreSQL, Prisma,
.env, the token gate, governance checkers, and automation contract failures. - Explain how
pnpm doctorandpnpm statushelp localize problems.
pnpm doctor runs tools/doctor/src/cli.mjs and reports environment readiness — Node version, pnpm, Docker/PostgreSQL availability, environment variables, and database connectivity — without modifying anything. Run it first whenever setup or a push fails unexpectedly.
pnpm status reads the shared task registry, verifies the lease chain for active tasks, checks ownership conflicts, and runs a live governance probe. It fails (FAIL) when the registry is invalid, ownership overlaps, or the governance probe reports failed checks, and suggests a next action. Use pnpm status --json for a machine-readable report.
Run pnpm governance to see exactly which checker failed.
-
Demo database won't start — run
pnpm db:start(docker compose up -d --force-recreate --wait postgres). Re-runpnpm doctorto confirm connectivity. -
Port conflict / wrong host — the local databases must be reachable at
127.0.0.1:54329; the reset guard rejects any other URL. ConfirmDATABASE_URLuses that host. -
E2E rejects the URL —
scripts/test-e2e.mjsrequires a local PostgreSQL URL ending in_test, or it will create a disposable one itself. A rejected variable raises[E2E] DATABASE_URL DITOLAK.
-
Client out of date — run
pnpm db:generateafter schema changes, thenpnpm db:migrateandpnpm db:seed. -
Migration drift — run
pnpm db:migrate; for a clean local reset usepnpm db:reset(guarded to disposable databases only). Never run destructive resets against a non-local database.
-
Missing variables —
.envis gitignored and never read by agents.pnpm run setupvalidates it. Required:DATABASE_URL,APP_URL,NODE_ENV. -
Stale values — re-run
pnpm run setupafter environment changes.DATABASE_URLmust bepostgresql://on127.0.0.1:54329with a name ending in_localor_test.
pnpm check fails at the token step when raw colour or border-radius values appear outside packages/token/src/tokens.css, or when tokens fail WCAG 2.2 AA contrast. Import tokens from @sentra/token instead of hard-coding values. See patterns-and-conventions.md and scripts/check-tokens.mjs.
pnpm governance runs the SAFRS Python checkers in tools/safrs/ plus governance tests. Common failures:
-
HANDOFF stale — a non-trivial change set that does not update
.agents/HANDOFF.mdfailscheck_handoff.py. Update the handoff. -
Ownership/lifecycle mismatch —
check_lifecycle.pyandcheck_task_ownership.pydetect drift between the task registry, lease ledger, and lifecycle states. Claim/transition/close tasks correctly withpnpm task, and reconcile leases withpnpm saf lease reconcile. -
Sensitive-change review required — changes to verification controls (
.safrs/**,AGENTS.md,.github/workflows/**,tools/automation/**, security tests) are minimum R2 and must be flagged for designated review;check_sensitive_changes.pyenforces this. -
Registry mtime change —
pnpm statusreportsstatus-detected-registry-mtime-changeif the governance probe unexpectedly modified the registry; status must remain read-only. - Pre-commit partial stage — the Husky hook aborts if a file is partially staged (staged and unstaged changes at once). Stage the whole file or commit staged-only portions first.
When a pnpm saf subcommand fails closed, treat any unresolvable input as a deny — never guess. Common causes:
-
Contract/digest mismatch — recompile the task contract with
pnpm saf contract compile task.json --write .safrs/contracts/task.json; digests must stay byte-identical across Node and Python (validated bycheck_task_contract.pyandtest/canonical-json.test.mjs). -
Gate verdict not PASS — inspect the verdict with
pnpm saf gate --all; a failing gate reports its reason. See automation tool and the control plane. -
Missing ledger issue — only
CLAIMmay create a ledger issue; other lease actions on an unknown task are denied. -
Dispatched but silent lease — never infer success from dispatching
safrs-task-control; read the ledger back and treat a missing event as deny (reconcileLeaseenforces this).
The 5 workflows are described in tooling.md. For red checks, read the failing step's log; the governance workflow runs each checker as a separate step so the failing one is named directly. E2E browser evidence is uploaded as a playwright-results artifact on failure.
SAFRS — the Sentra Agent-First Repository Standard — defines how a software repository should be structured, governed, and enforced when autonomous Artificial Intelligence agents perform a substantial share of engineering work by Sentra Artificial Intelligence.
SAFRS v1.1 addresses that problem through five coupled mechanisms:
- a six-layer repository architecture from Trust Boundary to Human Authority;
- a role-based permission model in which capability never implies trust;
- a four-tier risk model with cumulative mandatory controls;
- a multi-agent execution protocol with explicit task states and one mutation owner per bounded scope;
- a knowledge governance model that distinguishes current architecture, historical decisions, execution plans, Git history, and running code.
Built in Indonesia as part of the Sentra Artificial Intelligence ecosystem.
Sentra Artificial Intelligence · Source Repository · Official Website
Dr Ferdi Iskandar — Creator & Maintainer
LinkedIn ·
ORCID ·
Hugging Face ·
Kaggle ·
Medium ·
Substack ·
X ·
Threads
MyPrompt · Sentra Artificial Intelligence · Indonesia
- SentraBot
- Kediri History
- Academic Smartboard
- Avery
- Portfolio Dr. Novia
- Golden Path (legacy demonstrator)
- Control Center
- Capsule template
- Risk model (R0–R3)
- Agent roles and permissions
- Capsule sovereignty
- Multi-agent protocol
- Document lifecycle
- Sensitive paths
- Verification integrity
Lore — how this repository grew
- Schemas (
@safrs/schemas) - Environment (
@safrs/env) - Database (
@safrs/database) - API (
@safrs/api) - UI (
@safrs/ui) - Telemetry (
@safrs/telemetry) - Token (
@sentra/token) - Config (
@safrs/config) - Auth (
packages/auth)
- SAFRS governance checkers
- SAFRS Automation Control Plane
- Gaffer Runtime
- Doctor
- Project wizard
- project-standalone
- Capabilities
- Codegen
- Deps-graph
- Status CLI
- Task CLI