Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Write for a reader who did not see your session. Rules: CONTRIBUTING.md. -->

## What was wrong
<!-- What happens today or is missing, for whom, and why it matters. "Fixes #<issue>" when there is one; the issue does not replace this section. -->

## What changed
<!-- What the change does, and why this way and not another. Name what users or bots will notice: settings, files in ~/.pots, a new dependency and why. For text the model reads (the system prompt, a tool's description, a skill), quote the old and the new wording. -->

## How it was tested
<!-- The commands you ran and their result: npm run check, npm test, and npm run tla when AGENTS.md rule 6 asks for it. For a fix: that its new test fails without it. For a chat app or a system: whether you tried it on the real one, what worked there, and what you did not try. -->

## Not done
<!-- What this does not do yet, or did not test. Delete the section if there is nothing. -->
18 changes: 15 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

Here to install or use Pots for someone, not to change its code? Read [docs/for-agents.md](docs/for-agents.md) instead.

Opening an issue or a pull request here? Read [CONTRIBUTING.md](CONTRIBUTING.md) first.

1. Read `README.md` first. It explains what the bot is and how the layers fit together.
2. Keep the layers apart. Platform concepts (Slack `ts`, channel types, subtypes) stay inside `src/channels/<platform>/`. The other layers speak only in channel, place, thread, message and person, and addresses are opaque strings.
3. Code gives mechanisms: receive, log, wake, send, schedule. Judgment belongs to the agent: whether to speak, where, when, and when to turn the page. Do not add a rule you would not tell a human coworker.
2. Keep the layers apart. Platform concepts (Slack `ts`, channel types, subtypes) stay inside `src/channels/<platform>/`. The other layers speak only in channel, place, thread, message and person, and addresses are opaque strings. A need that is not only one chat app's, such as who may wake the bot, is met once in the gateway core, not with settings of one channel.
3. Code gives mechanisms: receive, log, wake, send, schedule. Judgment belongs to the agent: whether to speak, where, when, and when to turn the page. Do not add a rule you would not tell a human coworker. Every event the bot receives is logged, at least who, where and when: code may decide not to wake the bot for it, but the bot can always find that it came.
4. Prefer code mode over new tools. The agent has `read`, `write`, `edit`, `bash`, `grep`, `find`, `screen`, `send`, `react`, `call`, `task` (its children) and `codemode` (scripts that call the other tools and MCP servers), and writes the rest itself. Do not build a tool for what the agent already does with what it has: it was not trained on your tool, so it may keep its own way or get yours wrong.
5. Never commit tokens, keys, personal data or runtime data. Runtime data lives in `~/.pots/`: bots in `bots/`, secrets in `secrets/`.
6. Run `npm run check` and `npm test` before you commit. When you change the inbox, the waker, the outbox or the timers, also run `npm run tla` and keep `spec/` in step with the code. See [docs/development.md](docs/development.md).
6. Run `npm run check` and `npm test` before you commit. When you change the inbox, the waker, the outbox, the timers or how a run waits for a model that fails, also run `npm run tla` and keep `spec/` in step with the code. See [docs/development.md](docs/development.md).
7. What pi-durable keeps (conversations, submissions, tasks, children) is stored only there: do not keep a copy of it in Pots' own tables in `bot.sqlite`. When a change of that state must reach the agent, make both in one pi-durable commit, with a request ID made from a durable ID. A table of ours for what only people see, such as `bot_working` for the typing indicator, is fine.

## Principles
Expand All @@ -22,3 +24,13 @@ They hold for every design, prompt text and change, as the rules above do.
6. A prompt says only what must be said. A longer prompt limits the model and can mislead it. "提示词越复杂反而越限制模型智力并增加误导的可能性…除非是啥必须说的"
7. Chat channels are the agent's tools. It picks the right action itself, without extra code or rules. "把聊天渠道当 agent 的工具来用,agent 会自己用合适的操作,而不是加代码加规则"
8. Give the agent the context a human coworker would have, instead of thinking up more cases. Then its judgment is close to a person's, and its mistakes are ones a person could make. "这道题的解法不应该是进一步思考各个场景,而是进一步完善上下文,尽可能把人类同等的上下文给到pots,这样pots大概率判断效果和人类相似,就算犯错了,也大概是人类有可能犯的错误"

## Code Review Rules

Report as P1 a change that:

- puts a platform concept outside `src/channels/<platform>/`, or meets a need that is not only one chat app's with settings of one channel (rule 2);
- keeps an event out of the log (at least who, where and when), or decides in code what the agent should judge, such as whether, where or when to speak (rule 3);
- adds a tool or a `pots` command for what the agent already does with `bash` and code mode (rule 4);
- changes the inbox, the waker, the outbox, the timers or how a run waits for a model that fails without `spec/` in step (rule 6);
- keeps a copy of what pi-durable keeps in Pots' own tables (rule 7).
1 change: 0 additions & 1 deletion CLAUDE.md

This file was deleted.

1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Contributing

Every issue and pull request follows the rules and principles in [AGENTS.md](AGENTS.md). A design that breaks one is redone or replaced, even if it works.

Most issues and pull requests here come through a coding agent, so this file is written for agents; it holds for people too. The people and agents who read yours did not see your session: give them what they need to decide without asking you. You post for a person, who answers for it: post only what they asked for and have read. Write in English, and never post tokens, personal data or people's messages.

1. Search the open and closed issues and pull requests first. If one covers the need, add what is new there.
2. A new feature, setting or change of behaviour starts as an issue. Say the need: who has it, in which situation, what happens today, and why it matters. Think across chat apps, not only the one you use. You may propose a design, but the maintainers decide it; a pull request opened before that may be redone or replaced. A bug fix whose test shows the bug can come as a pull request at once.
3. A bug report says what happened, what you expected, how to make it happen again, `pots --version`, the system, the chat app, and the lines of `pots service logs` or `pots trace` that show it.
4. A pull request is one change. Its title says what changes in a user's words, like the titles in `git log`. Its description fills the sections of [.github/pull_request_template.md](.github/pull_request_template.md) and stands on its own: a link to an issue is not a description. Write only what you ran and saw.
5. In the same pull request, change the docs that describe what you changed: README.md, `docs/` (`docs/development.md` says what each test file checks) and `skills/`. Do not edit CHANGELOG.md or the version: a maintainer does that at release.
6. When the pull request opens, Codex's GitHub review comments on it, and CI runs `npm run check`, `npm test` and an install test on Linux, macOS and Windows (for a first-time contributor, after a maintainer approves the run). Answer each review comment in its thread: fix it, or say why not. Push fixes as new commits, not a force-push, and say in the description what changed after review. Then a maintainer's agent reviews it against the rules and principles in AGENTS.md, and the maintainers decide. Keep "Allow edits by maintainers" on: they may push commits to your branch to finish it, or, when the design must change, make the change themselves with you as co-author.
1 change: 1 addition & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@./AGENTS.md
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ npm test # tests, including a real gateway with a fake model
npm run tla # the TLA+ models of the inbox, outbox, waker and a model that fails (needs Java and tla2tools.jar)
```

`npm run build` writes the JavaScript that the npm package ships to `dist/`. Set `POTS_HOME` to try things without touching `~/.pots/`. With `OTEL_EXPORTER_OTLP_ENDPOINT` set, the gateway also sends its traces to any OpenTelemetry tool (Jaeger, Grafana Tempo, Honeycomb). Tests, the TLA+ models and traces in detail: [docs/development.md](docs/development.md). Coding agents: read [AGENTS.md](AGENTS.md). Agents that set Pots up for someone: read [docs/for-agents.md](docs/for-agents.md).
`npm run build` writes the JavaScript that the npm package ships to `dist/`. Set `POTS_HOME` to try things without touching `~/.pots/`. With `OTEL_EXPORTER_OTLP_ENDPOINT` set, the gateway also sends its traces to any OpenTelemetry tool (Jaeger, Grafana Tempo, Honeycomb). Tests, the TLA+ models and traces in detail: [docs/development.md](docs/development.md). Coding agents: read [AGENTS.md](AGENTS.md); to open an issue or a pull request, also [CONTRIBUTING.md](CONTRIBUTING.md). Agents that set Pots up for someone: read [docs/for-agents.md](docs/for-agents.md).

## Star history

Expand Down
Loading