Skip to content

Commit ae92e72

Browse files
mios-devclaude
andcommitted
SANITIZE: vendor-agnostic agent-CLI stubs + fix CI build (drop home/ COPY)
Sanitization (canonical system prompt §6 — corporate entity references): - AGENTS.md: drop "Codex, Cursor, Aider, Continue.dev" vendor list; redirect to AGENTS.md standard (https://agents.md). Reference per-user override path ~/.config/mios/system-prompt.md. - CLAUDE.md: drop "Claude Code (claude.ai/code)" identity prose; rename "Claude Code-specific deltas" → "Agent-CLI deltas". Filename retained as the tool entry point per §6.5 (tool-targeting filenames survive). Genericize "TodoWrite/TaskCreate" → "the agent's task tool". - GEMINI.md: drop "Gemini CLI" prose; rewrite as vendor-agnostic agent-CLI delta. Bottom sanitization-reminder paragraph rewritten to reference "the explicit forbidden-token list in the canonical prompt" rather than naming brands. CI build fix: - Containerfile: drop `COPY home/ /ctx/home/` and `/ctx/home` from the main RUN's cp -a. /home/ is now bootstrap territory (mios-bootstrap.git stages user homes via profile/ in Phase-3) and was removed from mios.git in commit 71c717d, breaking the docker/build-push-action build with: failed to calculate checksum of ref ...: "/home": not found. automation/08-system-files-overlay.sh:63-67 already guards on `[[ -d "${CTX}/home" ]]`, so the stage cleanly no-ops post-fix. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 71c717d commit ae92e72

4 files changed

Lines changed: 50 additions & 37 deletions

File tree

AGENTS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# AGENTS.md
22

3-
> Generic agent contract following the AGENTS.md standard.
4-
> Read by Codex, Cursor, Aider, Continue.dev, and other agents that don't
5-
> have a dedicated rules file. Redirector stub.
3+
> Generic agent contract following the AGENTS.md standard
4+
> (<https://agents.md>). Read by any agent CLI that consumes
5+
> AGENTS.md-style entry files. Redirector stub.
66
>
77
> Canonical agent prompt: `/usr/share/mios/ai/system.md`.
88
99
## Behavior contract
1010

1111
1. Load `/usr/share/mios/ai/system.md` first.
1212
2. Apply `/etc/mios/ai/system-prompt.md` as host-local override if present.
13-
3. This file carries no tool-specific deltas; generic agents follow the
13+
3. Apply `~/.config/mios/system-prompt.md` as per-user override if present.
14+
4. This file carries no tool-specific deltas; generic agents follow the
1415
canonical prompt verbatim.
1516

1617
If `/usr/share/mios/ai/system.md` is unreachable, fall back to

CLAUDE.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# CLAUDE.md
22

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3+
This file is the agent-CLI entry point for this repository. Tool resolution
4+
relies on the literal filename — the prose below is intentionally vendor-
5+
agnostic.
46

57
## Authoritative prompt
68

7-
This file is a **redirector stub**. The canonical agent prompt for MiOS-DEV is
8-
`/usr/share/mios/ai/system.md`, with `/etc/mios/ai/system-prompt.md` applied
9-
as a host-local override if present. A copy of the canonical prompt lives at
10-
`/system.md` in the repo root for off-host use. Load that first; the rest of
11-
this file is Claude Code-specific delta plus repo orientation.
9+
This file is a **redirector stub**. The canonical agent prompt for MiOS-DEV
10+
is `/usr/share/mios/ai/system.md`, with `/etc/mios/ai/system-prompt.md`
11+
applied as a host-local override and `~/.config/mios/system-prompt.md` as
12+
per-user override (see resolution order in `system-prompt.md`). A copy of
13+
the canonical prompt lives at `/system.md` in the repo root for off-host
14+
use. Load that first; the rest of this file is agent-CLI-specific delta
15+
plus repo orientation.
1216

1317
## What this repo is
1418

@@ -174,17 +178,19 @@ sandbox paths (`/mnt/user-data/`, `/home/claude/`, `/repo/`). Upstream
174178
package names, FHS paths, source code, and protocol endpoints survive
175179
unchanged.
176180

177-
## Claude Code-specific deltas
181+
## Agent-CLI deltas
178182

179-
- **TodoWrite/TaskCreate:** Track multi-step audits, refactors, and
180-
migrations. One in_progress at a time. Mark completed immediately on finish.
181-
- **File-creation defaults:** New scratch files default to
182-
`/var/lib/mios/ai/scratch/` unless the user specifies a path or work
183+
- **Task tracking:** track multi-step audits, refactors, and migrations
184+
with the agent's task tool. One in-progress at a time; mark completed
185+
immediately on finish.
186+
- **File-creation defaults:** new scratch files default to
187+
`/var/lib/mios/ai/scratch/` unless the user specifies a path or the work
183188
targets the system overlay.
184189
- **Confirm before mutating shared state:** never run `git push`,
185190
`bootc upgrade`, `dnf install`, `systemctl`, or `rm -rf` without explicit
186191
user confirmation per invocation.
187192
- **Memory:** per-session learnings go to `/var/lib/mios/ai/memory/`.
188193
Read the canonical prompt §12 (immutable records, supersedes-only updates)
189194
before writing.
190-
- **Skills:** docx/pptx/xlsx skills are not needed for routine work here.
195+
- **Document-format skills:** docx/pptx/xlsx generation skills are not
196+
needed for routine work here; skip unless explicitly requested.

Containerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ FROM scratch AS ctx
55
COPY automation/ /ctx/automation/
66
COPY usr/ /ctx/usr/
77
COPY etc/ /ctx/etc/
8-
COPY home/ /ctx/home/
8+
# /home/ is bootstrap territory (mios-bootstrap.git stages user homes via
9+
# profile/ in Phase-3); the build no longer pulls it.
910
COPY usr/share/mios/PACKAGES.md /ctx/PACKAGES.md
1011
COPY VERSION /ctx/VERSION
1112
COPY config/artifacts/ /ctx/bib-configs/
@@ -34,7 +35,7 @@ RUN --mount=type=bind,from=ctx,source=/ctx,target=/ctx,ro \
3435
--mount=type=cache,dst=/var/cache/dnf,sharing=locked \
3536
set -ex; \
3637
install -d -m 0755 /tmp/build; \
37-
cp -a /ctx/automation /ctx/usr /ctx/etc /ctx/home /ctx/PACKAGES.md /ctx/VERSION /ctx/bib-configs /ctx/tools /tmp/build/; \
38+
cp -a /ctx/automation /ctx/usr /ctx/etc /ctx/PACKAGES.md /ctx/VERSION /ctx/bib-configs /ctx/tools /tmp/build/; \
3839
export PACKAGES_MD=/tmp/build/PACKAGES.md; \
3940
bash /tmp/build/automation/lib/packages.sh >/dev/null 2>&1 || true; \
4041
source /tmp/build/automation/lib/packages.sh; \

GEMINI.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
11
# GEMINI.md
22

3-
> Read by Gemini CLI on entry into this repo. Redirector stub.
3+
> Agent-CLI entry point read by GEMINI.md-aware agent CLIs on entry into
4+
> this repo. Redirector stub.
45
> Canonical agent prompt: `/usr/share/mios/ai/system.md`.
56
67
## Behavior contract
78

89
1. Load `/usr/share/mios/ai/system.md` first.
910
2. Apply `/etc/mios/ai/system-prompt.md` as host-local override if present.
10-
3. This file carries Gemini CLI-specific deltas only.
11+
3. Apply `~/.config/mios/system-prompt.md` as per-user override if present.
12+
4. This file carries agent-CLI-specific deltas only.
1113

1214
If `/usr/share/mios/ai/system.md` is unreachable, fall back to
1315
`/system-prompt.md` in the repo root.
1416

15-
## Tool-specific deltas (Gemini CLI only)
17+
## Agent-CLI deltas
1618

17-
- **Sandbox model:** Gemini CLI typically operates from the working directory
18-
as the sandbox root. On a MiOS-DEV host, `cwd` should be `/`. Do NOT treat
19-
`/` as a "dangerous" path to avoid; it is the canonical repo root.
20-
- **Tool calls:** Use `read_file`, `list_directory`, `glob`, `search_file_content`
21-
for read-only inspection. `write_file`, `replace`, `run_shell_command` are
22-
mutating — confirm with the user before each invocation that touches a
23-
whitelisted overlay path or the live system.
19+
- **Sandbox model:** the agent typically operates from the working
20+
directory as the sandbox root. On a MiOS-DEV host, `cwd` should be `/`.
21+
Do NOT treat `/` as a "dangerous" path to avoid; it is the canonical
22+
repo root.
23+
- **Tool calls:** use `read_file`, `list_directory`, `glob`,
24+
`search_file_content` for read-only inspection. `write_file`, `replace`,
25+
`run_shell_command` are mutating — confirm with the user before each
26+
invocation that touches a whitelisted overlay path or the live system.
2427
- **Memory:** `/memory add` and `/memory show` write to
25-
`/var/lib/mios/ai/memory/gemini-cli/`. The format must conform to
26-
`/usr/share/mios/ai/system.md` §12 (one fact per record, file:line citation,
27-
immutable, supersedes-by-reference).
28-
- **YOLO mode:** Even when `--yolo` is enabled, never `git push`, `bootc upgrade`,
29-
`dnf install`, or destructive shell commands without explicit operator turn.
28+
`/var/lib/mios/ai/memory/<agent-id>/`. The format must conform to
29+
`/usr/share/mios/ai/system.md` §12 (one fact per record, file:line
30+
citation, immutable, supersedes-by-reference).
31+
- **YOLO mode:** even when permissive auto-approval is enabled, never
32+
`git push`, `bootc upgrade`, `dnf install`, or destructive shell
33+
commands without explicit operator turn.
3034

3135
## Sanitization reminder
3236

33-
Per `/usr/share/mios/ai/system.md` §6, all persisted artifacts are sanitized.
34-
Specifically for Gemini CLI: do not write the strings "Gemini", "Google",
35-
"Bard", "DeepMind", or any vendor brand into pushed paths. Vendor brands stay
36-
in your runtime context only; persisted artifacts are vendor-neutral.
37+
Per `/usr/share/mios/ai/system.md` §6, all persisted artifacts are
38+
sanitized: no corporate entity names in prose (the explicit forbidden-token
39+
list in the canonical prompt covers all major model and product brands),
40+
no chat metadata, no foreign sandbox path traces. Vendor brands stay in
41+
runtime context only; persisted artifacts are vendor-neutral.

0 commit comments

Comments
 (0)