Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Releases/v5.0.0/.claude/PAI/ALGORITHM/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Use these to enrich understanding BEFORE or DURING ISC writing. Select in the pr
| IterativeDepth | OBSERVE | **Default at Extended+** when time budget allows deeper understanding; any important task where exploring the full problem space before ISC improves outcome; understanding what's actually being asked vs what was literally said; exploring different approach angles before committing; ambiguous scope, multi-faceted problems, hidden assumptions | `Skill("IterativeDepth")` | E2+ |
| ApertureOscillation | OBSERVE, THINK | Building something specific within a larger system; architecture decisions where scope framing changes the answer; feature design where tactical and strategic views may diverge; system coherence checks; scope negotiation. Complementary to IterativeDepth — ID rotates lenses, AO oscillates scope. Use AO when two distinct zoom levels (tactical target + strategic context) exist. | `Skill("ApertureOscillation")` | E3+ |
| FeedbackMemoryConsult | PLAN | **First step of PLAN at Extended+.** Before committing to approach, grep `~/.claude/projects/${HARNESS_USER_DIR}/memory/feedback_*.md` by task keywords. Prevents repeating mistakes already documented. Turns the memory system from write-only diary into active guardrail. | `Bash('rg -l "KEYWORDS" ~/.claude/projects/${HARNESS_USER_DIR}/memory/feedback_*.md')` | E2+ |
| Advisor | VERIFY | **At commitment boundaries on multi-step ISAs.** Before approach commitment, when stuck, once after durable deliverable before declaring done. Skip for short reactive tasks. If empirical results contradict advisor, re-call surfacing the conflict — do NOT silently switch. | `bun ~/.claude/PAI/TOOLS/Inference.ts --mode advisor <task> <state> <question>` | E3+ |
| Advisor | VERIFY | **At commitment boundaries on multi-step ISAs.** Before approach commitment, when stuck, once after durable deliverable before declaring done. Skip for short reactive tasks. If empirical results contradict advisor, re-call surfacing the conflict — do NOT silently switch. | `bun ${PAI_DIR}/TOOLS/Inference.ts --mode advisor <task> <state> <question>` | E3+ |
| ReReadCheck | VERIFY→LEARN boundary | **Final gate before emitting response (v3.29 RR1).** Re-read user's last message verbatim; enumerate every explicit ask against what shipped; block `phase: complete` on any `✗`. Targets the 82% "missed ask" complaint cluster. MANDATORY at every tier — at E1 single-part it's a one-line block. No fast-path exemption. | *(inline doctrine step — no external tool)* | E1+ |
| FirstPrinciples | THINK | Architecture decisions, inherited assumptions, stuck on approach | `Skill("FirstPrinciples")` | E2+ |
| SystemsThinking | OBSERVE, THINK | Recurring problems, structural causes, feedback loops, unintended consequences, "why does this keep happening?" Iceberg model, causal loop diagrams, Senge archetypes, Meadows' 12 leverage points | `Skill("SystemsThinking")` | E3+ |
Expand Down
2 changes: 1 addition & 1 deletion Releases/v5.0.0/.claude/PAI/ALGORITHM/ideate-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ User says "ideate [problem]", "id8 [problem]", "generate ideas for [problem]", o

### Parameter Integration

Parameters control ideation behavior along a spectrum from pure free-form dreaming to tight analytical focus. Full schema: `~/.claude/PAI/ALGORITHM/parameter-schema.md`.
Parameters control ideation behavior along a spectrum from pure free-form dreaming to tight analytical focus. Full schema: `${PAI_DIR}/ALGORITHM/parameter-schema.md`.

**Parameter resolution** (during OBSERVE phase):
1. Algorithm detects preset/focus/params from user request
Expand Down
2 changes: 1 addition & 1 deletion Releases/v5.0.0/.claude/PAI/ALGORITHM/mode-detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ When detected:
**Triggers:** `ideate [problem]` | `id8 [problem]` | `generate ideas for` | `dream up solutions for`

1. Set `mode: ideate` in ISA frontmatter
2. Load `~/.claude/PAI/ALGORITHM/ideate-loop.md`
2. Load `${PAI_DIR}/ALGORITHM/ideate-loop.md`
3. Map effort tier to `time_scale` per ideate-loop.md

## Optimize Mode
Expand Down
2 changes: 1 addition & 1 deletion Releases/v5.0.0/.claude/PAI/ALGORITHM/optimize-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Referenced from the Algorithm when `mode: optimize`. This file defines the compl

### Parameter Integration

Optimize mode accepts tunable parameters that control mutation boldness, regression tolerance, and patience. Full schema: `~/.claude/PAI/ALGORITHM/parameter-schema.md`.
Optimize mode accepts tunable parameters that control mutation boldness, regression tolerance, and patience. Full schema: `${PAI_DIR}/ALGORITHM/parameter-schema.md`.

**Optimize parameters:**

Expand Down
26 changes: 13 additions & 13 deletions Releases/v5.0.0/.claude/PAI/ALGORITHM/v6.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

**The ISA has twelve sections (NEW v6.2.0).** Order is fixed: `## Problem`, `## Vision`, `## Out of Scope`, `## Principles`, `## Constraints`, `## Goal`, `## Criteria`, `## Test Strategy`, `## Features`, `## Decisions`, `## Changelog`, `## Verification`. Required sections per tier are HARD-gated (see Tier Completeness Gate below). Empty sections never appear — Bitter Pill discipline preserved. Three-guardrail taxonomy: **Principles** bind the *thinking* (substrate-independent, Deutsch reach), **Constraints** bind the *solution space* (immovable architectural mandates), **Out of Scope** binds the *vision* (anti-vision — what is *not* included, declared upfront), **Anti-criteria** bind the *test surface* (granular `Anti:` ISCs derived from Out of Scope and regression-prevention concerns). The first three are author-stated; anti-criteria are derived probes.

**The ISA Skill (NEW v6.2.0)** at `~/.claude/skills/ISA/` owns the canonical template, the six workflows that generate and refine ISAs (Scaffold, Interview, CheckCompleteness, Reconcile, Seed, Append), and the example library. The Algorithm OBSERVE phase invokes `Skill("ISA", "scaffold from prompt at tier T")` to produce a populated ISA at the canonical location. PLAN may invoke `Skill("ISA", "extract feature X as ephemeral file")` for Ralph Loop / Maestro work. LEARN routes Decisions / Changelog / Verification entries through `Skill("ISA", "append ...")` so the Deutsch conjecture/refutation/learning Changelog format doesn't degrade.
**The ISA Skill (NEW v6.2.0)** at `<harness-home>/skills/ISA/` owns the canonical template, the six workflows that generate and refine ISAs (Scaffold, Interview, CheckCompleteness, Reconcile, Seed, Append), and the example library. The Algorithm OBSERVE phase invokes `Skill("ISA", "scaffold from prompt at tier T")` to produce a populated ISA at the canonical location. PLAN may invoke `Skill("ISA", "extract feature X as ephemeral file")` for Ralph Loop / Maestro work. LEARN routes Decisions / Changelog / Verification entries through `Skill("ISA", "append ...")` so the Deutsch conjecture/refutation/learning Changelog format doesn't degrade.

**The ISA is a living articulation.** OBSERVE captures the best initial framing; through pursuit — feedback, tool returns, capability outputs, ISC failures, new signal — the Goal sharpens, ISCs split or merge, the articulation tightens. Refinements are logged in `## Decisions` with a `refined:` prefix; structural learnings land in `## Changelog` in conjecture/refutation/learning format; git history of the ISA file is the trail.

Expand Down Expand Up @@ -79,13 +79,13 @@ REASON: <one sentence>
SOURCE: classifier | fail-safe
```

The executor reads this directly. **No regex fallback. No model judgment.** If `MODE` is MINIMAL or NATIVE, the executor uses the corresponding format from CLAUDE.md and stops. If `MODE` is ALGORITHM, the executor enters the Algorithm at the named `TIER`.
The executor reads this directly. **No regex fallback. No model judgment.** If `MODE` is MINIMAL or NATIVE, the executor uses the corresponding format from the harness startup instructions and stops. If `MODE` is ALGORITHM, the executor enters the Algorithm at the named `TIER`.

**Classifier rules (encoded in the hook's system prompt):**

- **MINIMAL** — greetings, ratings, single-token acknowledgments.
- **NATIVE** — single fact lookup OR single-line edit on a named file OR one command run, AND no new artifact created, AND no multi-step plan.
- **ALGORITHM** — everything else. Includes any build/create/make/implement/design/refactor/migrate/integrate request, anything touching multiple files, anything ambiguous, anything affecting doctrine/system-prompt/hooks/CLAUDE.md/Algorithm/ISA, anything spanning multiple projects, any meta-question about the system itself.
- **ALGORITHM** — everything else. Includes any build/create/make/implement/design/refactor/migrate/integrate request, anything touching multiple files, anything ambiguous, anything affecting doctrine/system-prompt/hooks/startup instructions/Algorithm/ISA, anything spanning multiple projects, any meta-question about the system itself.
- **Tier (ALGORITHM only)** — E1 trivial (~<90s), E2 single-domain (~3min), E3 multi-file substantial (~10min), E4 cross-cutting/doctrine/architecture (~30min), E5 comprehensive (>2h). Bias higher when in doubt.

**Override hierarchy (executor side):**
Expand Down Expand Up @@ -167,7 +167,7 @@ The `CheckCompleteness` workflow enforces this gate. A miss blocks `phase: compl
- EXECUTE / VERIFY / LEARN: `Skill("ISA", "append <type> to <isa-path>: <content>")` — canonical writer for Decisions / Changelog / Verification.
- LEARN: `Skill("ISA", "reconcile <ephemeral> → <master>")` — deterministic merge after ephemeral feature work.

**v6.2.x deferred:** parser updates so `ISASync.hook.ts`, `CheckpointPerISC.hook.ts`, and `hooks/lib/isa-utils.ts` automatically discover `<project>/ISA.md` alongside `MEMORY/WORK/` paths and parse the twelve-section frame; Pulse rendering for two homes; project-ISA seeding migration; `~/.claude/skills/ISA/Tools/*.ts` CLI implementations. Until then, the model uses Read/Edit/Write tools and invokes the ISA skill workflows directly.
**v6.2.x deferred:** parser updates so `ISASync.hook.ts`, `CheckpointPerISC.hook.ts`, and `hooks/lib/isa-utils.ts` automatically discover `<project>/ISA.md` alongside `MEMORY/WORK/` paths and parse the twelve-section frame; Pulse rendering for two homes; project-ISA seeding migration; `<harness-home>/skills/ISA/Tools/*.ts` CLI implementations. Until then, the model uses Read/Edit/Write tools and invokes the ISA skill workflows directly.

### ISC Quality System

Expand Down Expand Up @@ -224,7 +224,7 @@ Modes (ideate, optimize) accept tunable parameters. Full schema and presets: `PA

**ALL WORK INSIDE THE ALGORITHM.** Every tool call, investigation, and decision happens within phases.

**Entry banner was already printed by CLAUDE.md.** The user has seen:
**Entry banner was already printed by the harness startup instructions.** The user has seen:
```
♻︎ Entering the PAI ALGORITHM… (v6.2.0) ═════════════
🗒️ TASK: [8 word description]
Expand All @@ -235,7 +235,7 @@ Modes (ideate, optimize) accept tunable parameters. Full schema and presets: `PA
**ISA stub** (immediately after voice):
1. Determine ISA home: project ISA at `<project>/ISA.md` if task targets existing project; task ISA at `MEMORY/WORK/{slug}/ISA.md` for ad-hoc work
2. **Invoke `Skill("ISA", "scaffold from prompt: <user message> at tier <tier>")`** — returns the populated ISA at canonical location with required sections per tier (NEW v6.2.0; replaces inline ISA construction)
3. For task ISAs the skill creates `~/.claude/PAI/MEMORY/WORK/{slug}/`; for project ISAs the skill reads existing `<project>/ISA.md` if present, or seeds it via the Seed workflow
3. For task ISAs the skill creates `${PAI_DIR}/MEMORY/WORK/{slug}/`; for project ISAs the skill reads existing `<project>/ISA.md` if present, or seeds it via the Seed workflow
4. Skill output is the path; Algorithm reads/edits it via Read/Edit tools through subsequent phases

**E1 fast-path exception:** at E1, the Algorithm may inline-write the minimal Goal+Criteria ISA without invoking the skill, to preserve the <90s budget. The skill invocation is mandatory at E2+.
Expand Down Expand Up @@ -347,7 +347,7 @@ Anti-criteria ≥1 and Antecedent ≥1-when-experiential are required. ID-stabil
**Knowledge check (on-demand):** If the task topic has likely prior work, search `MEMORY/KNOWLEDGE/` for relevant notes.

```bash
rg -i "TOPIC" ~/.claude/PAI/MEMORY/KNOWLEDGE/ --type md -l
rg -i "TOPIC" ${PAI_DIR}/MEMORY/KNOWLEDGE/ --type md -l
```

```
Expand Down Expand Up @@ -467,7 +467,7 @@ Use `Skill("ISA", "append verification to <isa-path>: ISC-N <probe-type> <eviden

### 🪢 CHECKPOINTS (per-step durability)

Every `[ ]`→`[x]` ISC transition fires `CheckpointPerISC.hook.ts`. For each repo in `~/.claude/checkpoint-repos.txt` with uncommitted changes, the hook auto-commits. Idempotent via sidecar `MEMORY/WORK/{slug}/.checkpoint-state.json`. (v6.2.x: hook will also fire on `<project>/ISA.md` edits once isa-utils discovery lands.)
Every `[ ]`→`[x]` ISC transition fires `CheckpointPerISC.hook.ts`. For each repo in `<harness-home>/checkpoint-repos.txt` with uncommitted changes, the hook auto-commits. Idempotent via sidecar `MEMORY/WORK/{slug}/.checkpoint-state.json`. (v6.2.x: hook will also fire on `<project>/ISA.md` edits once isa-utils discovery lands.)

━━━ ✅ VERIFY ━━━ 6/7

Expand Down Expand Up @@ -503,7 +503,7 @@ On **multi-step ISAs** (Extended+ effort, multi-file edits, architecture changes
3. **Once after producing a durable deliverable** — before setting `phase: complete` in LEARN

```bash
bun ~/.claude/PAI/TOOLS/Inference.ts --mode advisor --auto-state \
bun ${PAI_DIR}/TOOLS/Inference.ts --mode advisor --auto-state \
"TASK: one-sentence description" \
"QUESTION: specific decision point or 'any gaps before declaring done?'"
```
Expand Down Expand Up @@ -597,7 +597,7 @@ Agent({
| TYPE | Target surface | Gate |
|------|----------------|------|
| `knowledge` | `MEMORY/KNOWLEDGE/{People\|Companies\|Ideas\|Research}/<slug>.md` | **Inline write.** |
| `rule` | `CLAUDE.md` Operational Rules section | **Inline append.** |
| `rule` | Harness startup instructions Operational Rules section | **Inline append.** |
| `gotcha` | The relevant skill's `SKILL.md` Gotchas section | **Inline append.** |
| `state` | `USER/PROJECTS/PROJECTS.md` "Open Sessions to Resume" | **Inline append.** |
| `business` | `USER/BUSINESS/<topic>.md` | **Inline write/append.** |
Expand Down Expand Up @@ -629,7 +629,7 @@ Agent({

**WRITE REFLECTION JSONL** (Extended+ effort; skipped at E1):
```bash
echo '{"timestamp":"[ISO-8601]","effort_level":"[tier]","effort_source":"[auto|gate-floor|explicit]","task_description":"[TASK line]","criteria_count":[N],"criteria_passed":[N],"criteria_failed":[N],"prd_id":"[slug]","implied_sentiment":[1-10],"satisfaction_prediction":[1-10],"reflection_q1":"[Q1]","reflection_q2":"[Q2]","reflection_q3":"[Q3]","knowledge_flags":[N],"within_budget":[bool],"living_doc_refinements":[N],"doctrine_fired":{"live_probe":[bool],"advisor":[bool],"cato":[bool],"conflict":[bool],"thinking_floor_met":[bool],"completeness_gate_met":[bool]}}' >> ~/.claude/PAI/MEMORY/LEARNING/REFLECTIONS/algorithm-reflections.jsonl
echo '{"timestamp":"[ISO-8601]","effort_level":"[tier]","effort_source":"[auto|gate-floor|explicit]","task_description":"[TASK line]","criteria_count":[N],"criteria_passed":[N],"criteria_failed":[N],"prd_id":"[slug]","implied_sentiment":[1-10],"satisfaction_prediction":[1-10],"reflection_q1":"[Q1]","reflection_q2":"[Q2]","reflection_q3":"[Q3]","knowledge_flags":[N],"within_budget":[bool],"living_doc_refinements":[N],"doctrine_fired":{"live_probe":[bool],"advisor":[bool],"cato":[bool],"conflict":[bool],"thinking_floor_met":[bool],"completeness_gate_met":[bool]}}' >> ${PAI_DIR}/MEMORY/LEARNING/REFLECTIONS/algorithm-reflections.jsonl
```

---
Expand Down Expand Up @@ -659,8 +659,8 @@ If after compaction you don't know your state:

**Cold-start recovery (new session on existing work):**
1. For project work: read `<project>/ISA.md`
2. For task work: read ISA from `~/.claude/PAI/MEMORY/WORK/`
3. `~/.claude/PAI/MEMORY/STATE/work.json` has the session registry
2. For task work: read ISA from `${PAI_DIR}/MEMORY/WORK/`
3. `${PAI_DIR}/MEMORY/STATE/work.json` has the session registry

---

Expand Down
Loading