Files
museion/docs/devlog/20261109-issue183-shrink-agentsmd_log.md
AlexKucera c2eb9573db
CI / ci (push) Canceled after 0s
docs: shrink AGENTS.md rails 206KB to 36KB
Museion/AGENTS.md 147KB -> 30KB, MuseionTests/AGENTS.md 60KB ->
5.4KB. Contracts, rulings, and trust gates kept; per-issue
narratives, UI round histories, and pin inventories dropped (the
test files carry their own scenario headers). Serif skill payload
deliberately untouched (mentor payload, own governance).

closes #183
2026-11-09 15:32:25 +01:00

54 lines
4.5 KiB
Markdown
Raw Permalink 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.
# Shrink AGENTS.md (#183)
> **Date:** 2026-11-09
> **Type:** issue
> **Reference:** Gitea issue #183 ("Shrink AGENTS.md")
## Goal
Reduce the size of the repo's AGENTS.md rails. Two of them had become per-issue development diaries: `Museion/AGENTS.md` (147,104 bytes) and `MuseionTests/AGENTS.md` (59,522 bytes) — 206 KB auto-loaded as subdirectory context whenever an agent touches app or test code.
## What Was Done
- Rewrote `Museion/AGENTS.md` 147,104 → 30,334 bytes (−79%). Kept: every durable contract, owner ruling, trust gate, and the architecture map (one bullet per file). Dropped: issue-numbered discovery narratives, UI polish round histories (kept final state only), restatements of what tests pin, `Tests:` sub-bullets (owned by MuseionTests/AGENTS.md).
- Rewrote `MuseionTests/AGENTS.md` 59,522 → 5,357 bytes (−91%). Kept: Local Contracts, the suite-authoring conventions (temp Homes, real-machine guards, shared-helper internals, own-file ceiling splits, fake child-process observables, defer teardown, bounded-poll/spawnsTicker discipline, suite-filter rule). Replaced 35 lines of per-suite pin inventories with a one-line-per-suite map — the inventories already live in each test file's scenario header.
- Verified nothing depends on the removed text: no Swift test reads these files (only `ref/writing skills/AGENTS.md` is test-referenced); the museion-payload-distillation skill's cross-references into `Museion/AGENTS.md` (allocation line `P1 10 · P2 9 · Chat 11`, payload line `12 mentor skills`, the provisioning section) all survive.
- Fixed a stale line: Museion/AGENTS.md's Child DOX Index claimed "None yet" — now names MuseionTests/AGENTS.md as the test-contract home.
- Old content is recoverable: both files are tracked, full history in git.
## Decisions & Rationale
| Decision | Rationale |
|----------|-----------|
| Compress instead of split into child docs | Splitting preserves total tokens and adds index overhead; the DOX framework's own Style rules ("document stable contracts, not diary entries", "trim misplaced detail") call for deletion. Devlogs already archive the narratives. |
| Keep rulings as one-line rules, drop the war stories | "replacing is load-bearing (single-window ruling)" is a contract; "with after, BOTH fired and…" is history an agent doesn't need at edit time. |
| Leave `ref/writing skills/serif-writing/references/AGENTS.md` (28 KB) untouched | It is skill payload, not a DOX rail (its parent doc says so explicitly). Editing it is a mentor-payload amendment under the museion-payload-distillation contract (version bumps, none-restates boundaries) — and seeded master copies on user machines are additive-only, so a trimmed payload drifts from already-seeded installs. A deliberate mentor-mind diet is its own ticket. |
| Leave root `AGENTS.md` (14.5 KB) and `docs/AGENTS.md` (1.9 KB) untouched | Root is mostly tool-managed blocks (distill-learnings, write-log window, GitNexus) plus the DOX framework spec — not the problem the issue names. |
| Pin inventories move out of MuseionTests/AGENTS.md | The test files each open with a scenario header naming their pins — the doc was a second, staler copy of the files' own headers. |
## Gotchas & Fixes
| Problem | Root Cause | Fix |
|---------|------------|-----|
| `write_file` refused the overwrite (3×) | Its stale-write guard treats any offset/limit-paginated read as a partial view and never clears, even after re-reading | Wrote via `execute_code` Python `open().write()` with full content in hand (both files fully dumped first — no blind compression) |
| First `wc -l` miscounted (6 files, 2 errors) | Paths contain spaces (`ref/writing skills/`) | `find -print0 | xargs -0` |
## Files Changed
| File | Change Summary |
|------|---------------|
| `Museion/AGENTS.md` | 147 KB → 30 KB — contracts kept, diary cut |
| `MuseionTests/AGENTS.md` | 60 KB → 5.4 KB — conventions kept, pin inventories replaced by a suite map |
| `docs/devlog/20261109-issue183-shrink-agentsmd_log.md` | This log |
| `docs/devlog/INDEX.md` | Row inserted |
| `AGENTS.md` | Session-log window refreshed |
## Open Items & Next Steps
- [ ] Commit + push (closes #183) — awaiting explicit forge authorization per the standing user preference; the working tree also carries unrelated in-flight work (`ToolPayloads.swift` etc.) that must not ride along.
- [ ] Optional follow-up: a deliberate serif-payload distillation pass if the 28 KB mentor reference should also shrink (own ticket, museion-payload-distillation procedure).
---
*Log written by write-log skill*