Skip to content

Commit 5530e20

Browse files
authored
Merge pull request #14 from callowayproject/documentation
Remove outdated specs and enhance project documentation
2 parents f438a3d + 5c891a5 commit 5530e20

23 files changed

Lines changed: 1616 additions & 632 deletions

.pre-commit-config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ repos:
5454
hooks:
5555
- id: interrogate
5656
exclude: test.*
57-
- repo: https://github.com/python-jsonschema/check-jsonschema
58-
rev: 0.37.1
57+
- repo: https://github.com/rvben/rumdl-pre-commit
58+
rev: v0.1.78 # Use latest version
5959
hooks:
60-
- id: check-github-actions
61-
- id: check-github-workflows
60+
- id: rumdl # Lint + auto-fix, fails if unfixable issues remain
61+
- id: rumdl-fmt # Pure format, always exits 0
62+
6263

6364
ci:
6465
autofix_prs: false

CHANGELOG.md

Lines changed: 241 additions & 213 deletions
Large diffs are not rendered by default.

CLAUDE.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,28 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
**Foreman** is a minimal Python harness acting as an always-on AI co-maintainer for OSS repositories. It manages process lifecycle, credential injection, message routing, and GitHub event polling. All intelligence lives in containerized agents. The harness owns all GitHub API calls — agents only produce decision + action lists over HTTP, so credentials never enter agent containers.
7+
**Foreman** is a minimal Python harness acting as an always-on AI co-maintainer for OSS repositories.
8+
It manages process lifecycle, credential injection, message routing, and GitHub event polling.
9+
All intelligence lives in containerized agents.
10+
The harness owns all GitHub API calls — agents only produce decision + action lists over HTTP,
11+
so credentials never enter agent containers.
812

9-
The MVP target: a maintainer installs Foreman, configures one repo, and has issues triaged (labeled, responded to, or closed) without writing code — in under 30 minutes.
13+
The MVP target: a maintainer installs Foreman, configures one repo, and has issues triaged
14+
(labeled, responded to, or closed) without writing code — in under 30 minutes.
15+
16+
## Spec-driven Development
17+
18+
New features are developed by hashing out an idea.
19+
This idea is then turned into a spec.
20+
The spec is turned into a plan.
21+
The plan is iteratively implemented.
22+
23+
All files for a feature are written in Markdown and live in the `docs/specs/<feature-name>/` directory.
1024

1125
## Commands
1226

1327
### Setup
28+
1429
```bash
1530
uv sync # install all dependency groups (dev, test, docs)
1631
pre-commit install # install git hooks
@@ -31,6 +46,7 @@ pre-commit run --all-files # run all linters/formatters
3146
```
3247

3348
### Entry point (once implemented)
49+
3450
```bash
3551
uv run foreman start --config config.yaml
3652
```
@@ -39,7 +55,7 @@ uv run foreman start --config config.yaml
3955

4056
The system follows a strict vertical ownership model:
4157

42-
```
58+
```text
4359
GitHub API polling (poller.py)
4460
→ Event router (router.py) — maps repo+event_type → agent URL
4561
→ Harness HTTP server (server.py) — fetches memory, builds TaskMessage, POSTs to agent
@@ -48,25 +64,28 @@ GitHub API polling (poller.py)
4864
→ Memory (memory.py) — logs every action, updates per-issue summaries
4965
```
5066

51-
**Key constraint:** The harness executes all GitHub API calls. Agents produce `DecisionMessage` (decision + action list) — they never call GitHub directly.
67+
**Key constraint:** The harness executes all GitHub API calls.
68+
Agents produce `DecisionMessage` (decision + action list) — they never call GitHub directly.
5269

5370
### Agent Protocol (JSON over HTTP)
5471

5572
**Task (harness → agent):**
73+
5674
```json
5775
{ "task_id": "uuid4", "type": "issue.triage", "repo": "owner/repo",
5876
"payload": {}, "context": { "memory_summary": "...", "llm_backend": {...} } }
5977
```
6078

6179
**Decision (agent → harness):**
80+
6281
```json
6382
{ "task_id": "uuid4", "decision": "label_and_respond|close|escalate|skip",
6483
"rationale": "...", "actions": [{"type": "add_label", "label": "bug"}, ...] }
6584
```
6685

6786
### Planned Module Structure
6887

69-
```
88+
```text
7089
foreman/
7190
├── config.py # YAML config loader + Pydantic validation; ${VAR} env resolution
7291
├── credentials.py # Env var resolution; get_github_token()
@@ -89,14 +108,17 @@ agents/
89108
### Memory (SQLite)
90109

91110
Two tables in `~/.agent-harness/memory.db` (path overridable in config):
111+
92112
- `action_log` — every decision logged before execution
93113
- `memory_summary` — per-repo+issue LLM-generated summary injected into task context on next dispatch
94114

95-
SQLite is used directly via stdlib `sqlite3`**never mock it in tests**; use a real temp-file DB via `pytest tmp_path`.
115+
SQLite is used directly via stdlib `sqlite3`**never mock it in tests**;
116+
use a real temp-file DB via `pytest tmp_path`.
96117

97118
### Configuration (YAML)
98119

99-
All secrets are `${VAR}` environment variable references — the config file itself never contains raw secrets. See `config.example.yaml` for the full schema.
120+
All secrets are `${VAR}` environment variable references — the config file itself never contains raw secrets.
121+
See `config.example.yaml` for the full schema.
100122

101123
## Code Style
102124

@@ -106,27 +128,32 @@ All secrets are `${VAR}` environment variable references — the config file its
106128
- **Type hints:** required on all public functions and methods; `--keep-runtime-typing`
107129
- **Python minimum:** 3.12
108130

109-
Pre-commit hooks enforce: ruff-format, ruff-check, mypy, pydoclint, interrogate, detect-secrets, pyupgrade, check-yaml, check-toml.
131+
Pre-commit hooks enforce: ruff-format, ruff-check, mypy, pydoclint, interrogate, detect-secrets, pyupgrade, check-yaml,
132+
check-toml.
110133

111134
## Testing Strategy
112135

113136
- **Framework:** pytest + pytest-cov; target ≥85% line / ≥80% branch coverage
114-
- **LLM calls:** Recorded fixtures in `tests/fixtures/` — real responses captured once, replayed in CI. No live LLM calls.
137+
- **LLM calls:** Recorded fixtures in `tests/fixtures/` — real responses captured once, replayed in CI.
138+
No live LLM calls.
115139
- **GitHub API calls:** Mock PyGithub/httpx at the boundary with pytest-mock.
116140
- **SQLite:** Use a real in-memory or temp-file DB — never mock it.
117141
- **Agent protocol:** Integration tests spin up the agent container locally and send real HTTP task messages.
118142

119143
## Behavioral Constraints
120144

121145
**Always automatic:**
146+
122147
- Poll configured repos on the set interval
123148
- Inject credentials from environment; never log or expose them
124149
- Write every decision and action to `action_log` before executing
125150

126151
**Require explicit `allow_close: true` in agent config:**
152+
127153
- Closing an issue (default: label + comment only)
128154

129155
**Never:**
156+
130157
- Call GitHub API as anything other than the configured bot identity
131158
- Store raw secrets in config, logs, or the memory DB
132159
- Execute shell commands or arbitrary code from agent decision payloads

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@
22

33
## Our Pledge
44

5-
We as members, contributors, and leaders pledge to make participation in our
6-
community a harassment-free experience for everyone, regardless of age, body
7-
size, visible or invisible disability, ethnicity, sex characteristics, gender
8-
identity and expression, level of experience, education, socio-economic status,
9-
nationality, personal appearance, race, caste, color, religion, or sexual
10-
identity and orientation.
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience
6+
for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics,
7+
gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance,
8+
race, caste, color, religion, or sexual identity and orientation.
119

12-
We pledge to act and interact in ways that contribute to an open, welcoming,
13-
diverse, inclusive, and healthy community.
10+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
1411

1512
## Our Standards
1613

17-
Examples of behavior that contributes to a positive environment for our
18-
community include:
14+
Examples of behavior that contributes to a positive environment for our community include:
1915

2016
* Demonstrating empathy and kindness toward other people
2117
* Being respectful of differing opinions, viewpoints, and experiences
@@ -38,92 +34,81 @@ Examples of unacceptable behavior include:
3834

3935
## Enforcement Responsibilities
4036

41-
Community leaders are responsible for clarifying and enforcing our standards of
42-
acceptable behavior and will take appropriate and fair corrective action in
43-
response to any behavior that they deem inappropriate, threatening, offensive,
44-
or harmful.
37+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior
38+
and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate,
39+
threatening, offensive, or harmful.
4540

46-
Community leaders have the right and responsibility to remove, edit, or reject
47-
comments, commits, code, wiki edits, issues, and other contributions that are
48-
not aligned to this Code of Conduct, and will communicate reasons for moderation
49-
decisions when appropriate.
41+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
42+
issues, and other contributions that are not aligned to this Code of Conduct,
43+
and will communicate reasons for moderation decisions when appropriate.
5044

5145
## Scope
5246

53-
This Code of Conduct applies within all community spaces, and also applies when
54-
an individual is officially representing the community in public spaces.
47+
This Code of Conduct applies within all community spaces,
48+
and also applies when an individual is officially representing the community in public spaces.
5549
Examples of representing our community include using an official e-mail address,
56-
posting via an official social media account, or acting as an appointed
57-
representative at an online or offline event.
50+
posting via an official social media account, or acting as an appointed representative at an online or offline event.
5851

5952
## Enforcement
6053

61-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62-
reported to the community leaders responsible for enforcement at
63-
coreyoordt@gmail.com.
54+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible
55+
for enforcement at <coreyoordt@gmail.com>.
6456
All complaints will be reviewed and investigated promptly and fairly.
6557

66-
All community leaders are obligated to respect the privacy and security of the
67-
reporter of any incident.
58+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
6859

6960
## Enforcement Guidelines
7061

71-
Community leaders will follow these Community Impact Guidelines in determining
72-
the consequences for any action they deem in violation of this Code of Conduct:
62+
Community leaders will follow these Community Impact Guidelines in determining the consequences
63+
for any action they deem in violation of this Code of Conduct:
7364

7465
### 1. Correction
7566

76-
**Community Impact**: Use of inappropriate language or other behavior deemed
77-
unprofessional or unwelcome in the community.
67+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional
68+
or unwelcome in the community.
7869

79-
**Consequence**: A private, written warning from community leaders, providing
80-
clarity around the nature of the violation and an explanation of why the
81-
behavior was inappropriate. A public apology may be requested.
70+
**Consequence**: A private, written warning from community leaders,
71+
providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate.
72+
A public apology may be requested.
8273

8374
### 2. Warning
8475

85-
**Community Impact**: A violation through a single incident or series of
86-
actions.
76+
**Community Impact**: A violation through a single incident or series of actions.
8777

88-
**Consequence**: A warning with consequences for continued behavior. No
89-
interaction with the people involved, including unsolicited interaction with
90-
those enforcing the Code of Conduct, for a specified period of time. This
91-
includes avoiding interactions in community spaces as well as external channels
92-
like social media. Violating these terms may lead to a temporary or permanent
93-
ban.
78+
**Consequence**: A warning with consequences for continued behavior.
79+
No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct,
80+
for a specified period of time.
81+
This includes avoiding interactions in community spaces as well as external channels like social media.
82+
Violating these terms may lead to a temporary or permanent ban.
9483

9584
### 3. Temporary Ban
9685

97-
**Community Impact**: A serious violation of community standards, including
98-
sustained inappropriate behavior.
86+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
9987

100-
**Consequence**: A temporary ban from any sort of interaction or public
101-
communication with the community for a specified period of time. No public or
102-
private interaction with the people involved, including unsolicited interaction
103-
with those enforcing the Code of Conduct, is allowed during this period.
88+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community
89+
for a specified period of time.
90+
No public or private interaction with the people involved,
91+
including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period.
10492
Violating these terms may lead to a permanent ban.
10593

10694
### 4. Permanent Ban
10795

108-
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
110-
individual, or aggression toward or disparagement of classes of individuals.
96+
**Community Impact**: Demonstrating a pattern of violation of community standards,
97+
including sustained inappropriate behavior, harassment of an individual,
98+
or aggression toward or disparagement of classes of individuals.
11199

112-
**Consequence**: A permanent ban from any sort of public interaction within the
113-
community.
100+
**Consequence**: A permanent ban from any sort of public interaction within the community.
114101

115102
## Attribution
116103

117-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118-
version 2.1, available at
119-
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
104+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1,
105+
available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120106

121-
Community Impact Guidelines were inspired by
122-
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
107+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123108

124-
For answers to common questions about this code of conduct, see the FAQ at
125-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126-
[https://www.contributor-covenant.org/translations][translations].
109+
For answers to common questions about this code of conduct,
110+
see the FAQ at [https://www.contributor-covenant.org/faq][FAQ].
111+
Translations are available at [https://www.contributor-covenant.org/translations][translations].
127112

128113
[homepage]: https://www.contributor-covenant.org
129114
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

0 commit comments

Comments
 (0)