Orion/.agents/skills/orion-fold/SKILL.md
Avi a66996ac10 Orion vault — clean initial history
Knowledge vault (Orion/PARA) migrated from the pre-Orion 484vault on
2026-10-01. Deliberately orphaned: prior history contained a plaintext
password and stays local-only on branch archive/pre-boilerplate-history.
Secrets and live Hermes state are gitignored.
2026-10-02 08:34:48 -05:00

72 lines
3.4 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.

---
name: orion-fold
description: "Roll up the oldest 2^k entries of an Orion vault's wiki/log.md into a fold page in wiki/folds/, moving the entries verbatim and leaving one pointer line, so the log stays cheap to read. Dry-run by default; writes only on --commit. Run when cascade reports more than 16 unfolded entries. Triggers on: fold the log, run a fold, log rollup, roll up the log."
---
# orion-fold — subtractive log rollup
The log is append-only, so it grows forever. A fold **moves** the oldest entries into a fold page — verbatim, lossless — and leaves one pointer line behind. Entries are never edited or deleted; they live one file over.
**When:** `orion-cascade` prints `Log: N / 16` every run. Over 16 → a fold is due. Default `k=4` (16 entries).
## Parameters
- `k` (default 4) — batch size `2^k`.
- `--commit` — write. **Without it, dry-run: print the fold, write nothing.**
Fewer than `2^k` unfolded entries → report the shortfall and stop.
## Entry format
An entry is everything from one `^## YYYY-MM-DD` heading to the next. The log is newest-first, so **the oldest entries are at the bottom.** A heading containing `[folded]` is a pointer, not an entry.
## Fold ID
`fold-k{K}-from-{EARLIEST}-to-{LATEST}-n{COUNT}` — e.g. `fold-k4-from-2026-01-02-to-2026-01-30-n16`. **If `wiki/folds/<ID>.md` exists, stop.**
## Procedure
1. **Select the oldest `2^k` unfolded entries** — from the bottom up.
2. **Self-check (blocking):**
- **No unfolded entry sits below your span.** If one does, you've picked a middle window — a hole later folds will never revisit. Re-pick.
- Every selected entry was located exactly (date + title). **Never remove an entry you didn't positively match** — leave it and report.
- Every numeric claim you'll write is present in a child entry.
3. **Write the fold page** (`wiki/folds/<ID>.md`):
```yaml
---
type: fold
fold_id: <ID>
entry_count: N
entry_range: {from: YYYY-MM-DD, to: YYYY-MM-DD}
created: YYYY-MM-DD
tags: [meta, fold]
---
```
Sections:
1. **Scope** — one paragraph: period and dominant themes.
2. **Entries** — table `Date | Title | One-sentence summary`.
3. **Key outcomes** — 3–7 bullets, each citing its entry's date.
4. **Cross-entry themes** — 0–4 bullets, each naming ≥2 entries, or "None".
5. **Contradictions or corrections** — or "None detected".
6. **Entries — verbatim** — the moved entries in full, headings demoted `##` → `###`, otherwise untouched.
**Extractive only.** Nothing that isn't in the entries.
4. **Dry-run:** print the page and what commit would do. Stop.
5. **On `--commit`:**
1. Write the fold page.
2. Remove the folded entries from `log.md`; where the newest of them sat, leave:
`## {TO} — [folded] {N} entries ({FROM} to {TO}) → [[wiki/folds/{ID}|{ID}]]`
3. Add the fold to `## Folds` in `wiki/index.md`.
4. Prepend a log entry: `## {TODAY} — [vault] Log fold: {N} entries ({FROM} to {TO})`, with log line count before → after.
6. **Reconcile:** entries remaining in `log.md` + entries in all fold pages = entries before. If it doesn't balance, stop and report.
## Rules
- **Dry-run by default.** Write only on `--commit`.
- **Subtractive and lossless** — entries move verbatim; never edited, never deleted.
- **Oldest first, verified.** No unfolded entry below the span.
- **Never remove what you didn't positively match.**
- **Extractive only.**
- **Reconcile before finishing.**