Skip to content

bashos — Constitution

The rules every change to this repo must satisfy, whoever makes it — a human or an AI agent. Agents read this before AGENTS.md conventions, the PRD, or the feature catalog. Ratified by merged PR; amended only per § 8.

1. Missions

bashOS is one platform from the terminal to the machine it runs on: a terminal-first AI runtime whose Markdown slash commands run on one kernel behind every surface (the CLI, the Textual desktop and the loopback GUI), on any machine that has a terminal. On a machine of its own it boots as Amrchy, the maintainer's fork of Omarchy, with bashOS as its layer. one-os builds, checks and deploys those machines, custom-built PCs among them, and proves each step in a VM before hardware is touched. Every part stays customizable and versatile, and nothing in the operating system or the hardware tooling widens what the AI loops can touch.

  1. Provide data, tools, resources and transparency for all stakeholders, operators, AI practitioners and the general public. Operators, contributors, agent builders, and the general public are first-class audiences. The aim is a shared, open commons: the same kernel, the same tools, and the same trail of evidence for everyone.
  2. Make AI assistance a first-class part of the terminal: route slash commands through a reliable kernel onto the engine, with runs, health and settings that anyone can inspect. The path starts with Claude slash commands through a LangGraph kernel onto the OpenCode engine. The terminal remains the home of record; nothing important happens only in a hidden session.
  3. Put that runtime in every operator's hands, from the CLI and from a GUI access layer that sits beside the terminal, not above it. The same kernel serves both; a no-build front end is one path to Overview, Console, Commands, Runs, Health, Engine and Settings — an open toolkit for working with all things terminal-first AI runtime.

These missions set the course; they do not claim the work is finished. They serve the README and the OS-shell PRD: a terminal-first runtime, with a GUI beside the terminal rather than above it. The earlier §1 text about bashos gui (one page, seven hash-routed scenes, same kernel, no-build front end) is absorbed into mission 3 and is kept as direction, not as a claim that the GUI already ships. Every feature must trace to them.

Sources: AGENTS.md, ADR 0005, docs/frontend/PRD-os-shell.md; amended by 0002 and 0003 (both proposed); the missions are frontend/PRD-os-shell.md §1.1.

2. Invariants (non-negotiable)

These rules are lifted from the repo's own agent guide; breaking one is grounds to reject a PR.

  • bashOS never implements a reasoning loop. Loops call the engine, never a model directly. (AGENTS.md)
  • Loops never get network or write tools. Never add a tool that writes, reaches the network, or spawns an agent not bound by the policy. (AGENTS.md)
  • opencode.jsonc is generated, committed, and credential-free. Never hand-edit it. (AGENTS.md)
  • Anthropic model IDs are limited to claude-opus-5-5 (the default), claude-sonnet-5-5 and claude-haiku-5-5, optionally anthropic/-qualified. Use no other Claude model strings. (AGENTS.md)
  • Nothing blocks on a human. (AGENTS.md)
  • Everything is async; never call sync invoke inside the kernel — use await llm.ainvoke(...). (AGENTS.md)
  • Kernel and engine code never print — emit typed events (src/bashos/events.py) and let the surface render them. (AGENTS.md)
  • The desktop owns the alternate screen: kernel/engine code must never print — emit typed events (events.py) and let the surface render them. (AGENTS.md)
  • Loops must short-circuit on missing args (usage) and config.dry_run (rendered prompt, no model call) — tests rely on the dry-run path. (AGENTS.md)
  • Anything that could block on a human must not: approval requests are (AGENTS.md)
  • Secrets (tokens, API keys) are never printed, logged or committed. (fleet rule)
  • CHANGELOG.md, when present, is not hand-edited once release-please owns it. (fleet rule)

3. Authority and precedence

When two documents disagree, the higher one wins and the lower one is fixed in the same PR:

  1. This constitution (and its ratified amendments in docs/amendments/)
  2. AGENTS.md — how to work here (commands, conventions, Definition of Done)
  3. The PRD (docs/frontend/PRD-os-shell.md) — what the product must do (requirement ids FRn / NFRn)
  4. features/features.yml — what it does today (stable feature ids)
  5. ADRs in docs/adr/ and specs — why and how a specific change was made
  6. Code, tests, generated files

4. Roles: humans and AI agents

Actor May May not
Maintainer (human) Ratify amendments, PRD changes and releases by merging PRs; change settings, secrets, branch protection —
AI agent Read this file first; open PRs on a branch with Conventional Commit titles; update the feature catalog, PRD block and docs in the same PR as the change; propose amendments Merge its own PRs; push to the default branch; force-push; change repo settings or branch protection; print or commit secrets; invent features or requirements (unknown = TBD)

5. How the artifacts relate

Artifact Answers Owned by Rule
docs/constitution.md What must always hold Maintainer Changes only by amendment (§ 8)
docs/amendments/NNNN-*.md How and why the rules changed Proposer → maintainer Append-only; ratified by merged PR
AGENTS.md / CLAUDE.md How to work here Repo Must link this file; CLAUDE.md imports @AGENTS.md
PRD What the product must do Maintainer Requirements carry stable ids (FRn, NFRn)
features/features.yml What the product does, where, proven how Repo Every user-facing feature has an id, status, location and prd: refs
PRD "Feature catalog" block PRD → feature trace Generated governance_lint.py prd-sync; never hand-edit
docs/adr/NNNN-*.md Why a hard-to-reverse decision was made Proposer One ADR per decision; an amendment may cite one
CHANGELOG.md What shipped release-please Generated from Conventional Commits; never hand-edit

6. Change process

Change Required in the same PR
Typo, docs fix, refactor with no user-visible effect Conventional Commit title
New or changed user-facing feature Entry in features/features.yml (status, link/docs, prd:), regenerated PRD block
New or changed requirement PRD edit with a new FRn/NFRn id (ids are never reused), feature prd: refs updated
Hard-to-reverse technical decision ADR in docs/adr/
Change to this constitution Amendment record in docs/amendments/ (§ 8)

7. Quality gates

Every PR passes the checks the repo's guide names:

  • make test (AGENTS.md)
  • make lint (AGENTS.md)
  • pytest -q (AGENTS.md)
  • python3 <bamr87/bamr87>/tools/governance_lint.py prd-sync . --write (AGENTS.md)
  • python3 <bamr87/bamr87>/tools/governance_lint.py check . (feature catalog ↔ PRD, constitution, amendments)

8. Amendments

This constitution changes only through a numbered record in docs/amendments/ (NNNN-kebab-slug.md, copied from 0000-template.md):

  1. Propose — open a PR that adds the record (Status: proposed) and the edit to this file it describes. Name what it affects: constitution sections, PRD requirement ids, feature ids.
  2. Review — the maintainer reviews; an agent never approves or merges its own amendment.
  3. Ratify — merging the PR ratifies it. The record says Status: ratified and Ratified by: the PR. A rejected or withdrawn PR keeps its record with that status; numbers are never reused.
  4. Supersede — a later amendment may replace an earlier one; mark the old record superseded by NNNN.

Records are append-only history: fix a ratified rule with a new amendment, never by editing an old record. 0001 ratifies this document.