Skip to content

Commit 3ef7e89

Browse files
committed
Add F1 multi-agent missions, ponytail/caveman skills, and graph design doc.
MissionWorkflow decomposes goals into parallel child AgentRunWorkflows with Postgres coordination, path-scoped edits, and mission-tagged memory. Document target DAG orchestration (scope doc, real edges, fan-in) for F2+.
1 parent 8a3621b commit 3ef7e89

34 files changed

Lines changed: 1806 additions & 34 deletions

‎.cursor/rules/caveman.mdc‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
description: Caveman mode — terse replies, full technical accuracy. Complements ponytail (code) with shorter prose.
3+
globs:
4+
alwaysApply: false
5+
---
6+
7+
# Caveman (token-efficient prose)
8+
9+
Use when the user wants brevity or when editing agent plan/observation text.
10+
11+
## Rules
12+
13+
- Drop filler, hedging, pleasantries. Fragments OK.
14+
- Keep code, commands, paths, API names, and error strings **exact**.
15+
- Never drop negations (`not`, `never`, `only`) — they change meaning.
16+
- Code blocks and JSON unchanged.
17+
- For docs and commits: write normal prose (caveman is for chat/plan summaries, not user-facing docs).
18+
19+
Pattern: `[thing] [action] [reason]. [next step].`
20+
21+
Upstream: [JuliusBrussee/caveman](https://github.com/JuliusBrussee/caveman) (MIT skill). Full skill in `third_party/caveman-skill/SKILL.md`.
22+
23+
Works with ponytail: caveman shrinks what you **say**; ponytail shrinks what you **build**.

‎.cursor/rules/ponytail.mdc‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
description: Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
3+
globs:
4+
alwaysApply: true
5+
---
6+
7+
# Ponytail, lazy senior dev mode
8+
9+
You are a lazy senior developer. Lazy means efficient, not careless. The best code is the code never written.
10+
11+
Before writing any code, stop at the first rung that holds:
12+
13+
1. Does this need to be built at all? (YAGNI)
14+
2. Does it already exist in this codebase? Reuse the helper, util, or pattern that's already here, don't re-write it.
15+
3. Does the standard library already do this? Use it.
16+
4. Does a native platform feature cover it? Use it.
17+
5. Does an already-installed dependency solve it? Use it.
18+
6. Can this be one line? Make it one line.
19+
7. Only then: write the minimum code that works.
20+
21+
The ladder runs after you understand the problem, not instead of it: read the task and the code it touches, trace the real flow end to end, then climb.
22+
23+
Bug fix = root cause, not symptom: a report names a symptom. Grep every caller of the function you touch and fix the shared function once — one guard there is a smaller diff than one per caller, and patching only the path the ticket names leaves a sibling caller still broken.
24+
25+
Rules:
26+
27+
- No abstractions that weren't explicitly requested.
28+
- No new dependency if it can be avoided.
29+
- No boilerplate nobody asked for.
30+
- Deletion over addition. Boring over clever. Fewest files possible.
31+
- Shortest working diff wins, but only once you understand the problem. The smallest change in the wrong place isn't lazy, it's a second bug.
32+
- Question complex requests: "Do you actually need X, or does Y cover it?"
33+
- Pick the edge-case-correct option when two stdlib approaches are the same size, lazy means less code, not the flimsier algorithm.
34+
- Mark deliberate simplifications that cut a real corner with a known ceiling (global lock, O(n²) scan, naive heuristic) with a `ponytail:` comment naming the ceiling and upgrade path.
35+
36+
Not lazy about: understanding the problem (read it fully and trace the real flow before picking a rung, a small diff you don't understand is just laziness dressed up as efficiency), input validation at trust boundaries, error handling that prevents data loss, security, accessibility, the calibration real hardware needs (the platform is never the spec ideal, a clock drifts, a sensor reads off), anything explicitly requested. Lazy code without its check is unfinished: non-trivial logic leaves ONE runnable check behind, the smallest thing that fails if the logic breaks (an assert-based demo/self-check or one small test file; no frameworks, no fixtures). Trivial one-liners need no test.

‎.gitmodules‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "third_party/ponytail"]
2+
path = third_party/ponytail
3+
url = https://github.com/DietrichGebert/ponytail.git

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Training platform for **Kubernetes + guardrails + Temporal + LangGraph** — tow
1515

1616
**Rule:** Temporal orchestrates. LangGraph reasons. Guardrails gate what gets written and deployed.
1717

18-
**Docs:** [docs/README.md](docs/README.md) · [Local dev](docs/local-dev.md) · [Agent roadmap](docs/agent-roadmap.md) · [Planned improvements](docs/planned-improvements.md)
18+
**Docs:** [docs/README.md](docs/README.md) · [Local dev](docs/local-dev.md) · [Agent roadmap](docs/agent-roadmap.md) · [Agent skills](docs/agent-skills.md)
1919

2020
---
2121

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: mission-schema-init
5+
namespace: lunar
6+
spec:
7+
ttlSecondsAfterFinished: 300
8+
template:
9+
spec:
10+
restartPolicy: OnFailure
11+
containers:
12+
- name: init
13+
image: postgres:16
14+
env:
15+
- name: PGHOST
16+
value: postgres
17+
- name: PGPORT
18+
value: "5432"
19+
- name: PGUSER
20+
valueFrom:
21+
secretKeyRef:
22+
name: lunar-db
23+
key: username
24+
- name: PGPASSWORD
25+
valueFrom:
26+
secretKeyRef:
27+
name: lunar-db
28+
key: password
29+
- name: PGDATABASE
30+
value: lunar
31+
command:
32+
- /bin/sh
33+
- -c
34+
- |
35+
psql -v ON_ERROR_STOP=1 <<'SQL'
36+
CREATE TABLE IF NOT EXISTS agent_missions (
37+
mission_id TEXT PRIMARY KEY,
38+
goal TEXT NOT NULL,
39+
status TEXT NOT NULL DEFAULT 'pending',
40+
plan JSONB NOT NULL DEFAULT '[]',
41+
synthesis TEXT,
42+
error TEXT,
43+
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
44+
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
45+
);
46+
47+
CREATE TABLE IF NOT EXISTS agent_mission_tasks (
48+
task_id TEXT NOT NULL,
49+
mission_id TEXT NOT NULL REFERENCES agent_missions(mission_id) ON DELETE CASCADE,
50+
role TEXT NOT NULL DEFAULT 'builder',
51+
goal TEXT NOT NULL,
52+
status TEXT NOT NULL DEFAULT 'pending',
53+
workflow_id TEXT,
54+
paths JSONB NOT NULL DEFAULT '[]',
55+
blocked_by JSONB NOT NULL DEFAULT '[]',
56+
artifacts JSONB NOT NULL DEFAULT '[]',
57+
error TEXT,
58+
sort_order INT NOT NULL DEFAULT 0,
59+
started_at TIMESTAMPTZ,
60+
completed_at TIMESTAMPTZ,
61+
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
62+
PRIMARY KEY (mission_id, task_id)
63+
);
64+
65+
CREATE INDEX IF NOT EXISTS idx_mission_tasks_status
66+
ON agent_mission_tasks (mission_id, status);
67+
SQL
68+
echo "mission schema ready"

‎docs/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Public docs for [agentic-workflows](https://github.com/CascadiaTech/agentic-work
1212
| [agent-roadmap.md](./agent-roadmap.md) | Phased plan — K8s → Temporal → LangGraph → GitHub agent |
1313
| [platform-architecture.md](./platform-architecture.md) | Four-layer north star and design decisions |
1414
| [guardrails-alternatives.md](./guardrails-alternatives.md) | Conftest + Python guardrails without Lunar Hub |
15+
| [agent-skills.md](./agent-skills.md) | Ponytail + caveman integration (Cursor + Temporal) |
16+
| [multi-agent.md](./multi-agent.md) | Multi-agent missions — Postgres board, parallel child workflows |
1517

1618
---
1719

‎docs/agent-roadmap.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,24 @@ Placeholder: [services/github-webhook/README.md](../services/github-webhook/READ
165165

166166
See [memory/README.md](../memory/README.md).
167167

168+
### Phase S — Agent skills (ponytail + caveman)
169+
170+
- [x] **S1:** Vendored MIT skill content — [agent-skills.md](./agent-skills.md), `third_party/`, Cursor rules
171+
- [x] **S1:** Temporal prompt injection — `AGENT_PONYTAIL`, `AGENT_CAVEMAN` in `temporal/config/agent_skills.py`
172+
- [ ] **S2:** Role-specific graphs (planner=caveman, builder=ponytail) in multi-agent mission workflow
173+
- [ ] **S3:** Optional Caveman Proxy for worker input compression (upstream BSL CLI, not vendored)
174+
175+
Upstream: [ponytail](https://github.com/DietrichGebert/ponytail) · [caveman](https://github.com/JuliusBrussee/caveman)
176+
177+
### Phase F — Multi-agent missions
178+
179+
See [multi-agent.md](./multi-agent.md) for graph engineering target (delegator DAG, fan-in, shared memory).
180+
181+
- [x] **F1:** `MissionWorkflow` + Postgres board + parallel child workflows
182+
- [ ] **F2:** Scope document, `depends_on` execution, `task_outputs`, LLM fan-in
183+
- [ ] **F3:** Role graphs — doc-agent, review-agent
184+
- [ ] **F4:** K8s worker always-on (deferred during local iteration)
185+
168186
### Phase D2 — Real code agent (git tools)
169187

170188
**Done (local lite):** LangGraph nodes `propose_edits` → `apply_edits` write files in **this repo** via path allowlist (`temporal/config/agent_config.py`). No git clone/PR yet.

‎docs/agent-skills.md‎

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Agent skills — ponytail + caveman
2+
3+
How [ponytail](https://github.com/DietrichGebert/ponytail) and [caveman](https://github.com/JuliusBrussee/caveman) integrate with this platform.
4+
5+
---
6+
7+
## Why both
8+
9+
| Skill | Shrinks | Where it applies |
10+
|-------|---------|------------------|
11+
| **Ponytail** | What agents **build** | Edit prompts, code diffs, guardrailed file writes |
12+
| **Caveman** | What agents **say** | Plan step strings, observations, chat-style output |
13+
14+
They compose: ponytail picks `<input type="date">` over a date-picker library; caveman writes "Use native date input" instead of a paragraph.
15+
16+
---
17+
18+
## Cursor (local development)
19+
20+
| File | Purpose |
21+
|------|---------|
22+
| `.cursor/rules/ponytail.mdc` | Always-on YAGNI ladder |
23+
| `.cursor/rules/caveman.mdc` | Optional terse prose mode |
24+
25+
Install / refresh:
26+
27+
```bash
28+
chmod +x scripts/install-agent-skills.sh
29+
./scripts/install-agent-skills.sh
30+
```
31+
32+
Optional full caveman skill via skills CLI (installs to gitignored `.cursor/skills/`):
33+
34+
```bash
35+
npx skills add JuliusBrussee/caveman -a cursor --yes
36+
```
37+
38+
---
39+
40+
## Temporal workers (autonomous agents)
41+
42+
Prompt injection lives in `temporal/config/agent_skills.py` and is appended to:
43+
44+
- **Plan nodes** — `DRAFT_PLAN_SYSTEM_PROMPT`, `REFINE_PLAN_SYSTEM_PROMPT` (caveman)
45+
- **Edit node** — `EDIT_SYSTEM_PROMPT` (ponytail)
46+
- **Observations** — compact memory writes (caveman hint)
47+
48+
Environment toggles on the worker:
49+
50+
```bash
51+
export AGENT_PONYTAIL=full # default
52+
export AGENT_CAVEMAN=lite # default
53+
export AGENT_PONYTAIL=off # disable ponytail ladder
54+
export AGENT_CAVEMAN=off # disable terse plans
55+
```
56+
57+
---
58+
59+
## Multi-agent orchestration (planned)
60+
61+
When `MissionWorkflow` lands, assign skills by role:
62+
63+
```text
64+
MissionWorkflow
65+
├── planner task → caveman (board + task titles)
66+
├── builder tasks → ponytail (minimal edits per task)
67+
└── reviewer task → ponytail-review pattern (delete-list)
68+
```
69+
70+
Shared **Postgres mission board** holds progress; shared RAG holds observations tagged by mission/task. Target graph design: [multi-agent.md](./multi-agent.md).
71+
72+
---
73+
74+
## Third-party layout
75+
76+
See [third_party/README.md](../third_party/README.md).
77+
78+
- `third_party/ponytail/` — optional git submodule (full upstream)
79+
- `third_party/caveman-skill/SKILL.md` — MIT skill text only
80+
81+
**Not included:** Caveman Proxy / Engine (BSL-1.1). Install separately if you want input-token compression:
82+
83+
```bash
84+
npm install -g @caveman-ai/cli && caveman setup --install
85+
```
86+
87+
---
88+
89+
## License
90+
91+
- Ponytail: MIT
92+
- Caveman skill: MIT
93+
- Caveman engine/proxy: BSL-1.1 — not vendored in this repo

‎docs/local-dev.md‎

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
11
# Local Development Setup for Temporal
22

3-
This document outlines the steps to set up and run Temporal locally using Python and uv.
3+
## Prerequisites
4+
Ensure you have the necessary environment set up for running Temporal locally.
45

56
## Quick Start Guide
7+
To quickly set up Temporal in a local development environment, follow these steps:
68

7-
Follow these steps to get your local Temporal setup ready using three terminals:
9+
1. **Start the Temporal server**:
10+
Open a terminal and run the following command to start the Temporal server:
11+
12+
```bash
13+
temporal server start-dev --db-filename /tmp/temporal-training.db
14+
```
15+
16+
This will start the Temporal server and ensure that the UI is accessible at [http://localhost:8233](http://localhost:8233).
817

9-
### Terminal 1: Start Temporal Server
10-
Run the following command to start the Temporal server:
11-
```bash
12-
temporal server start-dev --db-filename /tmp/temporal-training.db
13-
```
14-
The Temporal UI is available at [http://localhost:8233](http://localhost:8233) and the server listens on localhost:7233.
18+
2. **Run the Temporal worker**:
19+
Open another terminal and navigate to the Temporal workspace:
20+
21+
```bash
22+
cd temporal && uv run worker.py
23+
```
24+
Make sure to export your `OPENAI_API_KEY` before running this command.
1525

16-
### Terminal 2: Start Your Worker
17-
In a new terminal, navigate to the temporal directory and run your worker:
18-
```bash
19-
cd temporal && uv run worker.py
20-
```
21-
Make sure to export your `OPENAI_API_KEY` before running the worker.
26+
3. **Start the Temporal agent**:
27+
Finally, open a third terminal and run the following script to start the Temporal agent:
28+
29+
```bash
30+
./scripts/temporal/start-agent.sh
31+
```
2232

23-
### Terminal 3: Start the Temporal Agent
24-
In another terminal, start the Temporal agent:
25-
```bash
26-
./scripts/temporal/start-agent.sh
27-
```
28-
29-
Once all three terminals are running, you are set up to develop and test your Temporal applications locally.
33+
You should now have a fully operational local Temporal setup!

0 commit comments

Comments
 (0)