| Repo | github.com/signetai/signetai |
|---|---|
| GitHub issues/comments/PR comments | Use literal multiline strings or `-F - <<'EOF'` (or `$'...'`) for real newlines; never embed "\\n". |
| Branching | `<username>/<feature>` off `main`. |
| Conventional commits | `type(scope): subject`. Reserve `feat:` for user-facing features only; use `fix:`, `refactor:`, `chore:`, `perf:`, `test:`, `docs:`, `build:`, or `ci:` for internal changes. |
| Last Updated | 2026/05/21 |
| This file | AGENTS.md (canonical), `CLAUDE.md -> AGENTS.md`. |
This file guides AI assistants working in the Signet monorepo. The goal is durable repo work: inspect the real checkout, make scoped changes, add the guardrail that would have prevented the issue, and verify the affected runtime.
- Prefer repo truth and runtime truth over inference. Inspect the current files, package scripts, installed binary, daemon health, GitHub state, or failing test before proposing a fix.
- Stay on task. Do not widen a bug fix into a product redesign unless the user asks for it.
- Preserve unrelated work. The checkout may be dirty; never reset, checkout, or delete user changes unless explicitly asked.
- Work on a branch named
<username>/<feature>frommainfor repo changes. - Keep changes maintainable. Shared behavior belongs in shared code, not in repeated local patches.
- If a public claim, README, docs page, or API contract is affected, update the source of truth in the same PR.
For code changes, a complete pass normally includes:
- Reproduce or identify the behavior from the current checkout.
- Make the smallest durable change that fits the existing architecture.
- Add a prevention mechanism: regression test, invariant, validation check, CI guard, or process rule.
- Run the narrowest meaningful checks first, then broader checks when the blast radius justifies them.
- Validate the real daemon, CLI, package, dashboard, or installed runtime when the bug is runtime-specific.
- Inspect
git diffand make sure unrelated files are not included.
Typecheck, build, lint, and tests are not substitutes for runtime validation when the failure involves an installed CLI, daemon process, desktop shell, connector install, browser extension, or generated bundle.
A bug fix is incomplete until the same failure mode is harder to repeat.
Use at least one durable guardrail:
- Regression test for the failing behavior.
- Input/config validation at the boundary.
- Invariant check for scoped data, timers, runtime paths, or publish output.
- CI/publish manifest check for packaging failures.
AGENTS.mdor checklist refinement when the failure was process-related.
Prevent these proactively.
- Thread
agent_id/agentIdthrough every read and write touching user data. - Thread
visibilitywhere the data model supports it. - Never hardcode
"default"for scoped paths when a real agent id is known. - Scope ontology, source-backed rows, memories, sessions, analytics, and diagnostics consistently.
- Reject or explicitly handle cross-agent links, proposal applies, claim updates, and token scopes.
- Validate external inputs, config, CLI flags, request bodies, and environment variables at the boundary.
- Clamp counters, limits, latencies, intervals, offsets, and retry values to sane non-negative ranges.
- Reject out-of-range values with clear structured errors.
- Fail closed for auth, graph policy, mutation gates, source access, and publish/install integrity.
- Do not swallow errors or silently downgrade behavior.
- Log with enough context to diagnose path, agent id, source id, session key, runtime path, route, or package surface.
- Return structured failures from APIs and CLIs.
- For retry or refresh loops, enforce timeout floors, single-flight or serialization, and timer cleanup.
- Admin, refresh, diagnostics, source, connector, secret, and mutation endpoints need explicit permission checks.
- Expensive or abuse-prone paths need rate limiting in
teamandhybridmodes. - Never leak tokens or secret values into chat, logs, memory rows, fixtures, generated docs, or source files.
- Never inject GitHub tokens into non-GitHub remotes.
- Code is the authority. Refresh docs from implementation truth, not from old prose.
- Update behavior, API, schema, status, and user-facing docs in the same PR when affected.
- Keep
docs/API.mdaccurate for daemon route changes. - Root docs duplicated into
docs/are generated artifacts. Edit the root source, then runbun scripts/sync-root-docs.ts. - Do not hand-edit
docs/CONTRIBUTING.mdordocs/ROADMAP.md. - Use
bun scripts/doc-drift.tswhen architecture or migration docs might be stale.
- Do not duplicate constants, maps, dependency types, config defaults, package lists, or descriptions across files.
- Extract a shared source of truth when duplication would create drift.
- JS daemon changes must preserve Rust shadow/parity expectations in
platform/daemon-rswhen the behavior overlaps. - Connector install-time code and daemon runtime connector code are different surfaces; do not conflate them.
- Every bug fix needs a test that would fail before the fix.
- Test behavior, not implementation plumbing.
- Prefer integration-style tests when the contract crosses modules.
- Add edge-case tests for scoping, invalid inputs, timer lifecycle, permission checks, fallback behavior, generated manifests, and publish output.
- Keep prompt/model-dependent tests opt-in unless the existing command already defines a model-backed test loop.
Signet is a local source-backed substrate for agent continuity. Do not collapse it into "a memory app" or "a vector search wrapper."
- Source artifacts, transcripts, imported files, notes, configs, and documents are evidence.
- Memory rows are scoped, searchable recall records.
- Source-backed recall rows must preserve provenance and remain purgeable by source.
- Ontology stores reviewed structure, currentness, versions, links, and evidence.
- Epistemic assertions preserve who claimed, believed, observed, decided, preferred, denied, or questioned something.
- Skills own reviewed repeated behavior.
- Identity and AGENTS files hold operating policy.
- Secrets stay out of chat, memory, logs, and source files.
Automatic extraction is not permission to silently author policy, ontology, identity, or skill behavior.
- HTTP server defaults to port
3850. /serves the dashboard./api/*covers config, memory, skills, hooks, updates, diagnostics, auth, ontology, sources, and related daemon APIs./memory/*keeps search and similarity aliases./healthis the simple health check.- File watcher behavior includes debounced auto-commit and harness sync.
User data lives in $SIGNET_WORKSPACE/ (default ~/.agents/):
$SIGNET_WORKSPACE/
├── agent.yaml
├── AGENTS.md
├── SOUL.md
├── IDENTITY.md
├── USER.md
├── MEMORY.md
├── memory/
│ ├── memories.db
│ └── scripts/
├── skills/
├── .secrets/
└── .daemon/logs/
Do not present MEMORY.md as the database or as full source truth. It is a
generated working summary.
- The daemon pipeline lives in
platform/daemon/src/pipeline/. - Connectors send
x-signet-runtime-path: plugin|legacy. - A session may use one active runtime path; conflicts should return
409. - Pipeline stages include extraction, decision, optional knowledge graph, retention decay, document ingest, maintenance, and session summary.
- Important modes include
shadowMode,mutationsFrozen,graphEnabled, andautonomousEnabled.
For harness duplication or high-token memory reports, inspect the installed config and confirm only the intended Signet hook/plugin path is active.
- Use audited ontology operations for structured graph changes.
- Pending proposals are for large refactors, risky/destructive changes, or explicit review queues.
- Clear single operations should usually apply directly with provenance.
- Claim slots use
group_key+claim_key; version history must remain inspectable. - Raw source artifacts and transcripts must not be rewritten when graph or memory rows change.
relationsis legacy; new audited links useentity_dependencies.
Useful commands:
signet ontology pipeline explain --json
signet ontology proposals --status pending --json
signet ontology assertions --limit 50 --json
signet ontology entity merge-plan "Target" "Source" --json
signet ontology stream apply ops.jsonl --dry-run --jsonCredential resolution order:
- SSH remote (
git@...). - Credential helper.
GITHUB_TOKEN/ghCLI forgithub.comonly.
Rules:
- If no remote is configured, push/pull should skip gracefully.
- All git subprocesses that operate on the workspace must set
cwdtoAGENTS_DIR. - Sync must not trample unrelated dirty files.
| Package / area | Location | Purpose | Target |
|---|---|---|---|
@signet/core |
platform/core |
Types, DB, migrations, search, manifest, identity | node/bun |
@signet/daemon |
platform/daemon |
Hono API, hooks, file watching, pipeline, dashboard server | bun |
platform/daemon-rs |
platform/daemon-rs |
Rust shadow runtime and parity logging | rust |
@signet/native |
platform/native |
Native accelerators | node |
@signet/cli |
surfaces/cli |
Setup, config, daemon management, secrets, skills, sync | node/bun |
signet-dashboard |
surfaces/dashboard |
Svelte dashboard served by daemon | browser |
@signet/desktop |
surfaces/desktop |
Electron desktop shell and packaging | node/electron |
@signet/tray |
surfaces/tray |
Shared tray/menu state utilities | node |
@signet/extension |
surfaces/browser-extension |
Browser extension UI | browser |
@signet/sdk |
libs/sdk |
Third-party integration SDK | node |
@signet/connector-base |
libs/connector-base |
Shared connector primitives | node |
@signet/connector-* |
integrations/*/connector |
Install-time harness integrations | node |
@signet/opencode-plugin |
integrations/opencode/plugin |
OpenCode runtime plugin | node |
@signet/oh-my-pi-extension |
integrations/oh-my-pi/extension |
Oh My Pi extension/runtime bundle | browser |
@signet/pi-extension-base |
integrations/pi/extension-base |
Shared Pi/OMP extension utilities, source-only | node |
@signet/pi-extension |
integrations/pi/extension |
Pi extension/runtime bundle | node |
@signetai/signet-memory-openclaw |
integrations/openclaw/memory-adapter |
OpenClaw runtime adapter | node |
signetai |
dist/signetai |
Installable distribution package | npm |
@signet/web |
web/marketing |
Astro marketing/docs site | cloudflare |
signet-reviews-worker |
web/workers/reviews |
Cloudflare review worker | cloudflare |
plugins/core/secrets |
plugins/core/secrets |
Core Signet-native secrets plugin | bun |
memorybench |
memorybench |
Benchmark harness, datasets, reports, local UI | node |
runtimes/forge |
runtimes/forge |
Forge runtime ecosystem | mixed |
@signet/pi-extension-base has no standalone build step. The Oh My Pi and Pi
extension builds consume it directly from workspace source.
bun install
bun run build
bun test
bun run lint
bun run format
bun run typecheck
bun run build:publish
bun run version:sync
bun run dev:web
bun run deploy:webbun run build must preserve this order:
build:core -> build:connector-base -> build:opencode-plugin -> build:native
-> build:oh-my-pi-extension -> build:connector-oh-my-pi
-> build:pi-extension -> build:connector-pi -> build:deps
-> build:signetai
Run focused checks directly:
bun test platform/daemon/src/pipeline/worker.test.ts
bun run --filter '@signet/daemon' build
bun run --filter '@signet/cli' testcd platform/daemon
bun run dev
bun run start
bun run install:service
bun run uninstall:service- Migrations live in
platform/core/src/migrations/. Add migrations sequentially and register them in the index. - Auth lives in
platform/daemon/src/auth/with middleware, policy, rate limiting, and token management. - Route changes usually need API docs and route tests.
- Long-running workers need timeout floors, cleanup, and single-flight protection where applicable.
cd surfaces/cli
bun src/cli.ts setup
bun src/cli.ts status- CLI behavior should match daemon API contracts and return clear failures.
- Prefer
--jsonsupport for surfaces that agents or scripts consume. - Setup and connector commands must be idempotent.
Dashboard stack: Svelte 5, Tailwind v4, bits-ui, CodeMirror 6, 3d-force-graph. Built static files are served by the daemon.
cd surfaces/dashboard
bun install
bun run dev
bun run build
bun run check- Use shadcn-svelte components where practical.
- Never run broad Biome autofix blindly in
surfaces/dashboard/. Scope it narrowly, inspect the diff, then reruncd surfaces/dashboard && bun run check. - For Svelte issues reported from root, reproduce with the root-level command if needed:
bunx svelte-check --tsconfig surfaces/dashboard/tsconfig.json- Desktop bugs require checking the installed app or active launcher path when the report is about shipped behavior.
- Verify daemon process path, symlink target, package version, and health endpoint before assuming the repo build is active.
- Keep tray logic in
@signet/tray; do not duplicate menu state in desktop.
Astro site:
cd web/marketing
bun run dev
bun run build
bun run deploy- Follow the current
web/marketingimplementation patterns. - Edit generator/source files rather than generated artifacts.
- Keep public copy honest: source truth, provenance, accepted changes, skills, and agent continuity are stronger framing than generic "memory app" claims.
- Publishable packages must not ship runtime dependencies on unpublished workspace packages.
- Validate publish manifests after version rewriting and before npm publish.
- Bundle/install changes need smoke tests against the real generated package, installer script, or global command path.
Useful checks:
bun test scripts/check-publish-manifests.test.ts
bun run build:publish- Package manager: Bun.
- Lint/format: Biome.
- Build tool:
bun buildand package scripts. - Line width: 80-100 soft, 120 hard.
- Add comments only for tricky or non-obvious logic.
- Aim for files under roughly 700 LOC when it improves clarity or testability.
TypeScript conventions:
- Avoid
any,as, and non-null assertions (!). Useunknown, narrowing, and explicit null checks. - Prefer discriminated unions over optional-property bags.
- Use
readonlywhen mutation is not intended. - Do not use
enum; preferas constand union types. - Exported functions should have explicit return types.
- Prefer result types over exceptions at recoverable boundaries.
- Keep module scope effect-free.
- Prefer
const, early returns, and ternaries. - Avoid unnecessary reassignment and
elsechains. - Prefer functional array methods and type-guard filters when they improve inference and clarity.
- Reduce variable count by inlining values used once.
- Avoid unnecessary destructuring.
- Prefer short single-word names unless they become ambiguous.
See CONTRIBUTING.md for fuller style examples.
SIGNET_PATH workspace data dir override
SIGNET_PORT daemon port override
SIGNET_HOST daemon client address override
SIGNET_BIND daemon bind address override
SIGNET_BYPASS set to 1 to bypass hooks
OPENAI_API_KEY used when embedding provider is OpenAI
Before opening a PR, verify:
- The branch is based on
mainand named<username>/<feature>. - Agent scoping and visibility are correct on changed data queries.
- Inputs, config, env vars, and bounds are validated.
- Error handling and fallback paths are explicit and tested.
- Admin, refresh, diagnostics, source, secret, and mutation endpoints have permission checks and rate limits where needed.
- Runtime paths, timers, and cleanup behavior are covered when touched.
- Docs were updated for API, schema, status, or behavior changes.
- Generated docs were produced from root sources, not hand-edited.
- Publish manifests were validated if publishable packages changed.
- Each bug fix has a regression test or an explicit prevention guard.
- Lint, typecheck, build, and tests were run at the right scope.
- The real daemon, CLI, desktop app, connector, extension, installer, or site was validated when the change affects runtime behavior.
AI_POLICY.mdCONTRIBUTING.mddocs/API.mddocs/AUTH.mddocs/ARCHITECTURE.mddocs/DASHBOARD.mddocs/HOOKS.mddocs/PIPELINE.mddocs/SOURCES.mddocs/knowledge-graph-control-plane.mddocs/specs/INDEX.mddocs/research/