agentleFS
sipyourdrink-ltdsipyourdrink-ltd/bernstein/.github/copilot-instructions.md

bernstein

Copilot instructions1.4k starsChanged 58 days agoApache-2.0View on GitHub

Bernstein is the open-source governance layer for AI agents (Python 3.12+), one git worktree per task. There is no model in the coordination loop - the orchestrator is deterministic Python, NOT an LLM - so the same plan replays to a byte-identical task graph. NEVER run uv run pytest tests/ - it leaks 100GB+ RAM. Always use scripts/run_tests.py.

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 1 mentionMay 2026: 2 mentionsJun 2026: 0 mentionsJul 2026: 1 mentionAug 2026: 5 mentionsSep 2026: 37 mentionsOct 2026: 3 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the sipyourdrink-ltd/bernstein repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about sipyourdrink-ltd/bernstein

The biggest 5 of 49 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 49

Talked about on GitHub and Hacker News (49 times).

On GitHub · 47

42 more on GitHub

The file

We split this copilot-instructions.md into the rules it gives an agent

9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    All runtime state lives in .sdd/ as files (JSONL, YAML).

    line 39
  2. Distinctive:

    Use frozen dataclasses/TypedDict for all data - never raw dicts.

    line 40
  3. Very specific:

    NEVER run uv run pytest tests/ - it leaks 100GB+ RAM.

    line 55
  4. Distinctive:

    Default branch is main. NEVER push to master.

    line 59
  5. Distinctive:

    Don't modify files outside the task scope.

    line 61
  6. Very specific:

    Use pytest with unittest.mock for external deps.

    line 66
  7. Very specific:

    Use pytest.approx() for float comparisons, not ==.

    line 67
  8. Very specific:

    Use tmp_path fixture for file I/O tests.

    line 68
  9. Very specific:

    Test factories available in tests/factories.py.

    line 69

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Copilot Instructions

Bernstein is the open-source governance layer for AI agents (Python 3.12+), one git worktree per task. There is no model in the coordination loop - the orchestrator is deterministic Python, NOT an LLM - so the same plan replays to a byte-identical task graph.

Architecture

src/bernstein/
  core/                    # 21 sub-packages (orchestration, agents, tasks, quality, ...)
    __init__.py            # MetaPathFinder redirects old imports to sub-packages
    defaults.py            # All configurable constants (150+)
    server.py              # FastAPI task server (HTTP :8052)
    orchestration/         # Run loop, ticks, drain, scheduling
    agents/                # Lifecycle, spawning, identity, signals
    tasks/                 # Lifecycle, store, claim, retry, models
    quality/               # Gates, testing, review, architecture
    security/              # Auth, RBAC, permissions, compliance
    observability/         # Metrics, tracing, logging, alerting
    protocols/             # MCP, A2A, ACP, gRPC, cluster
    routing/               # Model routing, policies, bandit
    cost/                  # Tracking, budgets, forecasting
    tokens/                # Monitoring, context, compaction
    config/                # Seed parsing, settings, feature gates
    git/                   # Operations, worktrees, merge
    persistence/           # Store backends, WAL, checkpoints
    planning/              # Plans, recipes, planner
    communication/         # Bulletin, notifications, signals
    knowledge/             # Knowledge base, RAG, memory
    plugins_core/          # Plugin management, skills
  adapters/                # CLI agent adapters (claude, codex, gemini, etc.)
  cli/                     # CLI commands (commands/, display/, utils/, plan/)
  tui/                     # Textual TUI widgets

Key constraints

  • The orchestrator/scheduler is deterministic Python. NEVER add LLM calls for coordination.
  • Agents are short-lived: spawn per task, execute, exit. No long-running sessions.
  • All runtime state lives in .sdd/ as files (JSONL, YAML). No databases.
  • Use frozen dataclasses/TypedDict for all data - never raw dicts.
  • Type hints on ALL public functions. Pyright strict mode must pass.
  • Async for IO-bound, sync for CPU-bound.
  • New constants go in core/defaults.py, not inline.
  • New modules go in the appropriate sub-package, not in core/ root.

Before committing

uv run ruff check src/ --fix
uv run ruff format src/
uv run pyright src/
uv run python scripts/run_tests.py -x

NEVER run uv run pytest tests/ - it leaks 100GB+ RAM. Always use scripts/run_tests.py.

Git rules

  • Default branch is main. NEVER push to master.
  • One commit per logical change. Conventional commits (feat:, fix:, refactor:).
  • Don't modify files outside the task scope.

Testing

  • Tests in tests/unit/test_<module>.py.
  • Use pytest with unittest.mock for external deps.
  • Use pytest.approx() for float comparisons, not ==.
  • Use tmp_path fixture for file I/O tests.
  • Test factories available in tests/factories.py.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.