Skip to content

perf(commands): load /pharn-loop and /pharn-ship quick and stop text only when needed (6.32.0) - #294

Merged
PrzemekGalarowicz merged 9 commits into
mainfrom
worktree-orchestrator-context
Sep 28, 2026
Merged

PrzemekGalarowicz merged 9 commits into
mainfrom
worktree-orchestrator-context

Conversation

@PrzemekGalarowicz

Copy link
Copy Markdown
Contributor

Summary

/pharn-loop and /pharn-ship no longer send their --quick deltas on every request of a full run, or their stop procedure on every request before the stop. Each command keeps its entry-to-stop steps and gains two part files in .claude/commands/, each read at one named point:

  • pharn-<cmd>-quick.md — read only for a --quick run, at entry, batched with a call the run already makes;
  • pharn-<cmd>-close.md — the stop steps, the claims block and the Final step. The loop reads it at its first stop; ship reads it with step 7's return marker, or at an earlier STOP.

Each part has one pointer in its command. The pointer names the exact path, when the part is read, that it is trusted command text, and that it is re-read after a compaction. It also carries a not-loaded rule: stop, and never run a part from memory. No stage, order, route, check, stop decision, retry bound, ledger rule, commit rule or human gate moved. SKILLS_VERSION 6.31.2 → 6.32.0. MIN_CLI is unchanged: pharn-cli 0.7.0's own manifest and install code copy all four parts byte-identical.

Is it an optimization? (bytes measured; requests/tokens estimated)

path sent at invocation later loads added requests this text carried across the run est. net share of run prompt (~30k / ~120k prefix)
loop full, 1 iter 77,971 → 41,104 B close 34,340 B at the stop +1 −33% 6.8% / 2.5%
loop full, 3 iter same same +1 −38% 6.8% / 3.0%
loop full, blocked (S12) same same +1 −30% 6.5% / 1.7%
loop --quick, 1 iter same quick 12,197 B at entry + close +1 −17% 2.8% / 0.5%
ship full, GATE 2 67,543 → 34,104 B close 31,042 B with verify's marker +0 −34% 7.5% / 3.5%
ship full, STOP at regress same close at the STOP +1 −34% 6.2% / 1.9%
ship --quick, GATE 2 same quick 12,378 B at entry + close +0 −18% 4.3% / 1.9%

Bytes are measured. Request counts and tokens are estimates from a request profile counted over the pinned steps. No live before/after run was made. An unbatched quick Read would cost about 130k tokens at the larger prefix, more than a one-iteration quick loop saves; that is why the quick reads are batched.

Tests

.dev/floor/command-family.test.mjs pins:

  • the closed part set;
  • each part's frontmatter, name and framing;
  • one pointer per part, with its load-condition and not-loaded sentences;
  • no other command text naming a part (R5b);
  • no fenced line, heading or long paragraph in two files of one command;
  • which step headings each file holds.

Every pin has a negative control, and the review's six mutants are kept as regressions. The existing command pins read a command together with its parts through the dev-only helper .dev/floor/command-family.mjs. Not pinned: which file a body line under an unchanged heading sits in. Advisory: that a run reads a part at its point, and that a model follows a part it received as a Read result the way it follows an invoked command body. That was not run live; the follow-ups are parts-live-run and parts-visibility-probe.

Review

An independent /pharn-dev-review found 2 floor-gate findings. Both were claims that promised more than the tests pinned, and both are fixed in d2a059d. The advisory findings are applied, or stated in BUILD.md, "After the review". Pipeline records: .dev/features/orchestrator-context/ (PLAN, GRILL, BUILD, REGRESSION, VERIFY, REVIEW, SHIP).

Local verification on the merged tree

  • npm run check: every gate is green up to check:reconcile. check:reconcile is red only on the 5 files main's 6.31.2 changed; the build's epoch can't attribute the merge's writes, and CI reads NO_BASELINE.
  • npm test: 4266 / 4267 pass. The one failure is 6.31.2's own macOS-only projectRoot() test, which fails the same way on origin/main.
  • validate: a clean export is GREEN, 36 capabilities.
  • check:changelog-entry: GREEN.

🤖 Generated with Claude Code

PrzemekGalarowicz and others added 9 commits September 28, 2026 10:25
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/pharn-ship (6.32.0)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t pins)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion and not-loaded rule; narrow placement claims

REVIEW.md FG1: POINTER_PINS gains a per-part tier (WHEN and the not-loaded rule), every pin a control, the
review's six mutants kept as regressions, and R5b (a part's file name only in its pointer). FG2: CLAUDE.md,
CONTRIBUTING.md, the test header and both claims bullets narrowed to what R6/R7 pin. Advisory: close pointers
gain the untrusted-path sentence, every pointer a compaction re-read; loop stop routing matches Steps 1a/2;
quantifiers and numbers corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-context

# Conflicts:
#	CHANGELOG.md
#	README.md
#	SKILLS_VERSION
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 348fb16b-bef5-4201-b551-3af7f5ceae58


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@PrzemekGalarowicz
PrzemekGalarowicz merged commit c7449e4 into main Sep 28, 2026
8 checks passed
@PrzemekGalarowicz
PrzemekGalarowicz deleted the worktree-orchestrator-context branch September 28, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant