Files
DBAdmin/archive/NASA/openclaw_bootstrap.md
T
2026-05-18 06:40:19 +00:00

319 lines
11 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Jasne — z tego diagramu mogę przygotować **“bootstrap commands” dla OpenClaw**, które:
1. **tworzą strukturę folderów** (MCC + 3 misje + sekcje + archiwa)
2. **zapisują minimalne pliki startowe** (README + routing rules + templates)
3. **tworzą plik konfiguracyjny mapowania** (callsign → folder, callsign → agenci, SIM/FLIGHT gates)
⚠️ **Jedna ważna rzecz:** nie znam dokładnie Twojego interfejsu OpenClaw (CLI/REST/JSON-RPC/function calling).
Dlatego dam Ci **3 gotowe warianty** — wybierzesz ten, który pasuje do Twojej instalacji:
* **A) “OpenClaw Tool Calls” (najbardziej typowe w agentowych gatewayach)**
* **B) REST (jeśli OpenClaw ma endpointy)**
* **C) Shell bootstrap (gdy chcesz to odpalić lokalnie jednym skryptem, a OpenClaw ma tylko dostęp do FS)**
Wszystkie bazują 1:1 na Twoim diagramie: **PROGRAM LEAD / MCC / APOLLO / HUBBLE / ARTEMIS + sekcje i agenci**.
***
## 0) Ustal 2 parametry (wstaw w komendach)
Wszędzie używam placeholderów:
* `ROOT_PATH` gdzie ma powstać system (np. `/data/missions` albo `D:\org\missions`)
* `TODAY` data do paczek (OpenClaw może ją wyliczać sam)
Przykład:
* `ROOT_PATH=/data/missions` (Linux)
* `ROOT_PATH=D:\org\missions` (Windows)
***
# 1) Plik konfiguracyjny (to jest serce mapowania)
To jest **jedno źródło prawdy**, które OpenClaw powinien mieć (jako JSON).
Zapisz to jako:
`{ROOT_PATH}/_MCC/openclaw.missions.json`
```json
{
"root_path": "{{ROOT_PATH}}",
"wip_limit": 5,
"modes": {
"default": "SIM",
"flight_requires_checklist": true,
"flight_requires_program_lead_for_priority": ["P0", "P1"]
},
"governance": {
"program_lead": {
"name": "PROGRAM LEAD",
"responsibilities": ["Vision", "Strategy", "Final Decisions"]
},
"mission_control": {
"name": "MISSION CONTROL",
"alias": "MCC",
"responsibilities": ["Research", "Delegation", "Execution", "Orchestration"]
}
},
"missions": {
"APOLLO": {
"label": "FLIGHT SYSTEMS",
"sections": {
"APOLLO-CORE": { "folder": "APOLLO/CORE_TECH", "agents": ["Anvil", "Cipher"] },
"APOLLO-CODE": { "folder": "APOLLO/FLIGHT_CODE", "agents": ["Pixel", "Sentry"] },
"APOLLO-VERIFY": { "folder": "APOLLO/VERIFICATION", "agents": ["Inspector"] }
}
},
"HUBBLE": {
"label": "MISSION STORY",
"sections": {
"HUBBLE-CONTENT": { "folder": "HUBBLE/CONTENT", "agents": ["Rex", "Sage", "Echo", "Clip"] },
"HUBBLE-CREATIVE": { "folder": "HUBBLE/CREATIVE", "agents": ["Nebula", "Nova"] }
}
},
"ARTEMIS": {
"label": "MISSION OUTCOMES",
"sections": {
"ARTEMIS-EXP": { "folder": "ARTEMIS/EXPERIMENTS", "agents": ["Scout", "Herald"] },
"ARTEMIS-TLM": { "folder": "ARTEMIS/TELEMETRY", "agents": ["Forge", "Pulse"] },
"ARTEMIS-GROUND": { "folder": "ARTEMIS/GROUND_CREW", "agents": ["Beacon", "Link", "Vibe"] }
}
}
},
"packet": {
"name_format": "YYYY-MM-DD__CALLSIGN__slug",
"required_files": [
"00_brief.md",
"10_worklog.md",
"30_results.md",
"40_decision.md",
"90_links.md"
],
"artifact_dir": "20_artifacts"
}
}
```
***
# 2) “Bootstrap” — co ma powstać na dysku (docelowy stan)
OpenClaw ma stworzyć:
```text
ROOT/
_MCC/
00_operating-manual.md
10_backlog.md
20_active-missions.md
30_decisions.md
40_routing-rules.md
50_templates/
task-brief.md
sim-flight-checklist.md
post-mission-report.md
decision-record.md
openclaw.missions.json
90_archive-index.md
APOLLO/
CORE_TECH/missions/
FLIGHT_CODE/missions/
VERIFICATION/missions/
99_archive/
HUBBLE/
CONTENT/missions/
CREATIVE/missions/
99_archive/
ARTEMIS/
EXPERIMENTS/missions/
TELEMETRY/missions/
GROUND_CREW/missions/
99_archive/
```
***
# 3) Wariant A — OpenClaw “Tool Calls” (najbardziej pasuje do Twojego opisu ToolManager)
Zakładam, że OpenClaw potrafi wykonywać narzędzia typu:
* `fs.mkdir`
* `fs.write_file`
* `fs.append_file`
Jeśli nazwy masz inne, podmień — struktura zostaje identyczna.
## 3.1 Komendy tworzące katalogi
```json
{
"tool": "fs.mkdir",
"args": { "path": "{{ROOT_PATH}}/_MCC" }
}
```
Potem (kolejno):
```json
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/_MCC/50_templates"} }
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/APOLLO/CORE_TECH/missions"} }
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/APOLLO/FLIGHT_CODE/missions"} }
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/APOLLO/VERIFICATION/missions"} }
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/APOLLO/99_archive"} }
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/HUBBLE/CONTENT/missions"} }
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/HUBBLE/CREATIVE/missions"} }
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/HUBBLE/99_archive"} }
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/ARTEMIS/EXPERIMENTS/missions"} }
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/ARTEMIS/TELEMETRY/missions"} }
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/ARTEMIS/GROUND_CREW/missions"} }
{ "tool":"fs.mkdir", "args":{"path":"{{ROOT_PATH}}/ARTEMIS/99_archive"} }
```
## 3.2 Komendy zapisujące pliki MCC (startowe)
### `_MCC/40_routing-rules.md`
```json
{
"tool": "fs.write_file",
"args": {
"path": "{{ROOT_PATH}}/_MCC/40_routing-rules.md",
"content": "# Routing Rules (MCC)\n\n## Missions\n- APOLLO (Flight Systems): Core Tech, Flight Code, Verification\n- HUBBLE (Mission Story): Mission Content, Creative Studio\n- ARTEMIS (Mission Outcomes): Experiments, Telemetry, Ground Crew\n\n## Call-signs\n- APOLLO-CORE → APOLLO/CORE_TECH\n- APOLLO-CODE → APOLLO/FLIGHT_CODE\n- APOLLO-VERIFY → APOLLO/VERIFICATION\n\n- HUBBLE-CONTENT → HUBBLE/CONTENT\n- HUBBLE-CREATIVE → HUBBLE/CREATIVE\n\n- ARTEMIS-EXP → ARTEMIS/EXPERIMENTS\n- ARTEMIS-TLM → ARTEMIS/TELEMETRY\n- ARTEMIS-GROUND → ARTEMIS/GROUND_CREW\n\n## Default mode\nSIM is default. FLIGHT requires SIM→FLIGHT checklist and approvals.\n"
}
}
```
### `_MCC/00_operating-manual.md` (skrót, ale wystarczający do startu)
```json
{
"tool": "fs.write_file",
"args": {
"path": "{{ROOT_PATH}}/_MCC/00_operating-manual.md",
"content": "# Operating Manual — Mission System\n\n## Governance\n- PROGRAM LEAD: vision, strategy, final decisions\n- MISSION CONTROL (MCC): triage, routing, execution, WIP, closure\n\n## Missions\n- APOLLO: Flight Systems\n- HUBBLE: Mission Story\n- ARTEMIS: Mission Outcomes\n\n## Packet standard\nEach packet folder contains:\n- 00_brief.md\n- 10_worklog.md\n- 20_artifacts/\n- 30_results.md\n- 40_decision.md\n- 90_links.md\n\n## Modes\n- SIM (default): drafts/experiments\n- FLIGHT: production/final. Requires SIM→FLIGHT checklist.\n\n## Closure decisions\nPROCEED | ITERATE | HOLD | SCRUB\n"
}
}
```
### Puste indeksy (żeby UI/LLM miał gdzie pisać)
```json
{ "tool":"fs.write_file", "args":{"path":"{{ROOT_PATH}}/_MCC/10_backlog.md","content":"# Backlog (MCC)\n\n"} }
{ "tool":"fs.write_file", "args":{"path":"{{ROOT_PATH}}/_MCC/20_active-missions.md","content":"# Active Missions (MCC)\n\n"} }
{ "tool":"fs.write_file", "args":{"path":"{{ROOT_PATH}}/_MCC/30_decisions.md","content":"# Decisions (MCC)\n\n"} }
{ "tool":"fs.write_file", "args":{"path":"{{ROOT_PATH}}/_MCC/90_archive-index.md","content":"# Archive Index (MCC)\n\n"} }
```
### Zapis config JSON (ten z sekcji 1)
```json
{
"tool": "fs.write_file",
"args": {
"path": "{{ROOT_PATH}}/_MCC/openclaw.missions.json",
"content": "{{PASTE_JSON_CONFIG_HERE}}"
}
}
```
## 3.3 Templates (MCC/50\_templates)
Wklejam tylko 1 przykład, resztę dodasz analogicznie — ale jeśli chcesz, w kolejnym kroku dam Ci wszystkie 4 jako osobne `fs.write_file`.
### `task-brief.md`
```json
{
"tool": "fs.write_file",
"args": {
"path": "{{ROOT_PATH}}/_MCC/50_templates/task-brief.md",
"content": "# [CALLSIGN] Task Brief — <title>\n\n**Routing:** [CALLSIGN]\n**Agent:** <AgentName>\n**Mode:** SIM | FLIGHT\n**Priority:** P0 | P1 | P2\n\n## Context\n\n## Goal\n\n## Output / Deliverables\n- [ ] \n\n## Constraints\n\n## Acceptance Criteria\n- [ ] \n\n## Risks / Unknowns\n- \n"
}
}
```
***
# 4) Wariant B — jeśli OpenClaw ma REST (przykładowe endpointy)
Jeśli Twój OpenClaw ma REST, zwykle wygląda to jak:
* `POST /tools/fs/mkdir`
* `POST /tools/fs/write_file`
Przykład requestu (curl):
```bash
curl -X POST http://localhost:18789/tools/fs/mkdir \
-H "Content-Type: application/json" \
-d '{"path":"'"$ROOT_PATH"'/_MCC"}'
```
I analogicznie dla pozostałych katalogów i plików.
> Jeśli powiesz mi jak u Ciebie wyglądają endpointy (1 przykład), przerobię cały bootstrap na gotowy skrypt `curl` 1:1.
***
# 5) Wariant C — jeśli chcesz “jednym strzałem” (shell/powershell)
To nie są “komendy OpenClaw”, ale jest to **najprostszy bootstrap**, który potem OpenClaw przejmie jako workspace.
## Bash (Linux/macOS)
```bash
ROOT_PATH="/data/missions"
mkdir -p "$ROOT_PATH/_MCC/50_templates"
mkdir -p "$ROOT_PATH/APOLLO/CORE_TECH/missions" "$ROOT_PATH/APOLLO/FLIGHT_CODE/missions" "$ROOT_PATH/APOLLO/VERIFICATION/missions" "$ROOT_PATH/APOLLO/99_archive"
mkdir -p "$ROOT_PATH/HUBBLE/CONTENT/missions" "$ROOT_PATH/HUBBLE/CREATIVE/missions" "$ROOT_PATH/HUBBLE/99_archive"
mkdir -p "$ROOT_PATH/ARTEMIS/EXPERIMENTS/missions" "$ROOT_PATH/ARTEMIS/TELEMETRY/missions" "$ROOT_PATH/ARTEMIS/GROUND_CREW/missions" "$ROOT_PATH/ARTEMIS/99_archive"
```
***
# 6) Dodatkowo: komenda OpenClaw do “utworzenia pakietu” (na przyszłość)
Po bootstrapie, OpenClaw może mieć komendę “create\_packet”, np.:
```json
{
"tool": "mcc.create_packet",
"args": {
"callsign": "ARTEMIS-TLM",
"mode": "SIM",
"priority": "P1",
"slug": "retention-drop-7d",
"owner_agent": "Pulse",
"brief": {
"context": "Spadek retencji w ostatnich 14 dniach.",
"goal": "Zdiagnozować spadek i zaproponować działania.",
"deliverables": ["Raport", "Rekomendacje", "Telemetry plan"],
"constraints": ["Brak zmian FLIGHT bez checklisty"],
"acceptance": ["Wskazany etap lejka", "2-3 eksperymenty", "metryki + progi"],
"risks": ["Brak pełnych danych"]
}
}
}
```
To już bezpośrednio korzysta z mapowania z `openclaw.missions.json`.
***
# 7) Jedno pytanie, żebym dał Ci **idealnie dopasowane komendy** (bez zgadywania)
👉 **Jak dokładnie wywołujesz narzędzia w OpenClaw?**
Wybierz jedną opcję:
1. **JSON tool calls** (jak w sekcji 3)
2. **REST** (daj mi 1 przykład endpointu)
3. **CLI** (pokaż jak wygląda pojedyncze polecenie)
Wystarczy przykład jednej działającej komendy (np. “mkdir”), a ja w następnym kroku wygeneruję Ci **pełny bootstrap jako jeden plik** (np. `bootstrap_openclaw.jsonl` albo `bootstrap.sh`), gotowy do odpalenia.