Repository navigation
Releases
v7.33.2
Fixed
-
enforce-writes-scope.cjsnow denies a write whose payload path holds a NUL byte, asprotect-trusted-paths.cjs
has since 6.73.1. Audit SEC-11 added that deny toprotect-trusted-paths.cjsonly.enforce-writes-scope.cjskept
judging such a path by its scope like any other name, so it allowed a NUL-bearing path its scope allowed: in an
installed project with no scope and no open run,x\u0000y.md(exit 0); in PHARN's dev checkout, an in-scope path
such as.dev/features/x/PLAN.mdfollowed by a NUL. Both guards now exit 2 on every row the new table measures (a NUL
infile_path,path,notebook_path,edits[].file_path, and with no tool name, in a dev and an installed
project), with the fixed messagea path contains a NUL byte, which echoes nothing from the path. Before, the dev
checkout's scope deny named the path in its message. Node'sfsrefuses such a name, so no file was written either
way: this is parity between the two guards, not a closed hole. The deny covers write calls only: a read tool carrying
a NUL path is still allowed unread by both, as every non-write tool is. The guard andpharn/LIMITS.md§7 (its list
of input the guards deny now names "a write call whose path holds a NUL byte") were changed by the maintainer, who ran
two reviewed patch scripts.guard-pathless-write.test.cjsdrops the parity exception 7.33.1 recorded for this row:
it now holds six NUL rows, one with an in-scope path whose exit code moves in both postures, plus aReadrow with a
NUL path that both guards allow, and asserts both guards agree on every row. Against the 7.33.1 guards its two ROWS
tests and the new fixed-text test fail.Why patch: a correction to shipped guard behaviour. No contract, field or wiring changed, and
MIN_CLIis
unchanged.
v7.33.1
Fixed
-
Both write guards now deny a write call that carries no path they can read, instead of allowing it (CORE-628).
A call whose tool name isWrite,Edit,MultiEditorNotebookEdit(any letter case), or that names no tool,
and that has no string path infile_path,path,notebook_pathoredits[].file_pathwas allowed by both
protect-trusted-paths.cjsandenforce-writes-scope.cjs: their per-path decision ran over zero paths and passed.
That covered a path sent under another key (target_file, say), a number, and a missingtool_input. An empty path
is denied too; before,enforce-writes-scope.cjsdenied it andprotect-trusted-paths.cjsallowed it. Both guards
now exit 2 with a fixed message that echoes nothing from the payload. No Claude Code route to these payloads is known,
since its four write tools always carryfile_pathornotebook_path. The change sets what happens when Claude Code
renames a field, and when another harness that reads.claude/settings.jsonstarts the guards with its own payload:
one that sends the path under another key is now denied every write, where before it was allowed every write without
a word.A tool name outside the four is still allowed unread, so a guard wired under a wider matcher leaves
ReadandBash
alone; a harness that starts the guards under another name for its write tool gets no protection from them.
pharn/LIMITS.md§7 states that bound with the measured before/after table, measured in a dev checkout and in an
installed project. The newguard-pathless-write.test.cjsruns one table of 20 payloads against both guards in both
postures and asserts the expected exit code and that both guards agree. Each denied payload has a twin with a readable
in-scope path that must be allowed, so the deny is attributed to the missing path. Against the 7.33.0 guards the
table's deciding tests fail.One difference between the guards was found and left as it was: in an installed project with no scope and no open
run,enforce-writes-scope.cjsallows a path holding a NUL byte thatprotect-trusted-paths.cjsdenies. The test
records it as the table's one exception.Why patch: a correction to shipped guard behaviour. No contract, field or wiring changed, and
MIN_CLIis
unchanged.
v7.33.0
Changed
-
Both write guards are now wired in exec form, as the
Stopguard has been since 6.12.0, so no shell sits between
Claude Code and either guard (CORE-625). The shipped.claude/settings.jsonwiresprotect-trusted-paths.cjsand
enforce-writes-scope.cjsas"command": "node"with"args": ["${CLAUDE_PROJECT_DIR}/.claude/hooks/<guard>.cjs"]
and"onFailure": "block", under the unchanged matcher. In the old shell form,
node "${CLAUDE_PROJECT_DIR}"/.claude/hooks/<guard>.cjs, the placeholder was substituted into ash -cstring
(Git Bash or PowerShell on Windows), so a project path containing", a backtick,$or\could stop the guard
from starting, or run text from the directory name. In exec form Claude Code startsnodedirectly with the path as
one argument. What the guards decide does not change, and no hook script changed.hook-wiring.test.cjsnow spawns
the committed entries without a shell on every platform (it no longer skips the guards on Windows, though CI runs on
Linux only). Each entry denies a trusted-doc write from a subdirectory, and also from a project whose path holds a
space,$, a backtick and". The negative controls: a relativeargspath does not start, the old shell-form
string fails the pin, and in that project the shell form does not start, while with only a space in the path it does.
pharn/LIMITS.md§7 replaces the path-character bound with the exec-form bullet. A project path containing\is
still not claimed, because the guards' own path folding reads a backslash as a separator.Exec form needs Claude Code 2.1.139 or later, the release whose changelog adds hook
args.onFailurecame in
2.1.295, so every client that blocks on a failed guard also hasargs. An older client was not measured. If it
ignoresargs, it starts barenode, which reads the hook payload on stdin as a script and exits 1 (measured with
Node 24.13.1), and the write goes through. On such a client, upgrade Claude Code, or keep the shell-form lines.Existing installs:
pharn updatefirst, then the wiring; roll back in the reverse order.pharn updatenever
editssettings.json, so an install keeps its shell-form lines, which still work, with the path bound above. Measured
with pharn-cli 0.23.0's owndiffHookWiring(itssrc/lib/hook-wiring.ts) on a 7.32.2settings.jsonagainst this
one:pharn statusreports the hook wiringmissingfor both guards, prints aREPLACEnote showing your line and
the shipped one for each, andpharn status --strictexits 1 until both are replaced. A pre-7.3.0 line without
onFailuregets the same twoREPLACElines, so one edit per guard clears both changes. For an install made on 6.0.0
this is the fourth hand edit ofsettings.json: anchoring (6.1.0), theStopentry (6.12.0),onFailure(7.3.0),
and this. No other hand edit is in this release.Why minor: the shipped wiring changed, and every install must copy it again for
pharn status --strictto pass.
Nothing an existing install runs stops working, so it is not major.MIN_CLIis unchanged, because pharn-cli writes
settings.jsononly when it is absent. The settings change and theLIMITS.mdedit were applied by the maintainer
outside the agent loop, before the build's reconciliation anchor (L68, L88). Record:
.dev/features/guard-exec-wiring/.
v7.32.2
Fixed
entry-gates.mjs --abortstops the entry gate runner and the gate it is running whenpscannot run, as under
Claude Code's Bash sandbox on macOS (CORE-615)./bin/psis setuid root and the sandbox refuses its exec, so the
loop's stop printedps is unavailable, so the recorded pid could not be verified; nothing was signalledand left the
runner and its test suite running (.dev/measurements/sandbox-probe-2026-11-29.md, L3). The runner now writes its own
witness: a worker thread rewritespharn/.run/pharn-entry/beat.json(nonce, feature, pid, a risingseq) every
250 ms. Whenpscannot run,--abortcounts the recorded pid as this runner only if two reads bound to the runner
record show a greaterseqwithin 10 s; anything else (no beat, a beat that stopped, a beat for another nonce) leaves
the pid unverifiable and nothing is signalled, as before. With nops -Alisting, the gate stopped is the group
run-gates records ingates/lock.child, read after the runner is frozen.psstays first when it runs. The same
applies to--startsuperseding an earlier runner. Bounds: a gate's own detached process groups are not reached
withoutps; a runner that dies after its last beat and whose pid is reused within the window would be misread (the
same class as the gap between apsread and the signal); both records live underpharn/.run/, so this is a
tested rule over unauthenticated records, never provenance, and it is weaker thanpsagainst a forger: the beat's
pid is self-reported, so a writer ofpharn/.run/can aim theps-free--abortat any process group the same user
owns (one it could signal itself). Unchanged and still fail-closed withoutps:--wait(a live pid reads alive),
run-gates' orphan reap (a group whose start cannot be read is not signalled) and stage-direct's liveness reads (a
live pid reads alive); in a normal run these readings are correct, and only a crash or a reused pid makes them cost
anything (a wait, or a refusal a person clears).
v7.32.1
Changed
- 2026-11-30: REVIEW.md now says when a review target went over the 1 MiB total size cap and
--allow-large-target
let it through (CORE-617). Since 7.31.0 the assignment record carries
total_size_override: {target_bytes, cap_bytes}for such a run, and stderr says so, but
pharn/floor/render-review.mjsnever read the field. A person reading only REVIEW.md could not tell the target was
over the cap, or by how much.- With the field present and well formed, the
## Assignment summarygains one line after theTarget:line: the
target's bytes, the cap's bytes, and that--allow-large-targetlet it through. - With no field, REVIEW.md is byte-identical to before. A test pins the SHA-256 of two renders taken from the renderer
as it stood before the change (unchanged since 7.31.0). - With a malformed field, the line says the field is not in the shape the emitter writes and that I10 refuses the
record. It shows no number, key or value from the field, and repairs nothing (a numeric string is not read as a
number). - The shape test exists once:
pharn/floor/check-review-assignments.mjsexports I10's test as
totalSizeOverrideProblem(),checkRecordcalls it with its reasons unchanged, and the renderer imports it. So
the renderer now loads the checker and, through it, the emitter module andnode:child_process; it calls no
process-spawning function. The figures are shown only when the shape test passes, and the renderer prints them as
digits. - CORE-596's review raised this, and its plan deferred it as a follow-up. Bound: the line shows what the record says.
It does not re-measure the target, and it cannot tell who passed the flag.
- With the field present and well formed, the
v7.32.0
Added
- 2026-11-30:
/pharn-regressmakes its base checkout withgit clone --sharedwhengit worktree addfails, so a
regress run under Claude Code's Bash sandbox can still reach a base-and-head verdict (CORE-616). The sandbox refuses
.git/worktrees/in the project's repository, and noallowWriteentry lifts it
(.dev/measurements/sandbox-probe-2026-11-29.md, sessions G and G2). So the stage'sgit worktree addfailed and the
stage stoppedunusable git-failedwith no verdict. That was predicted from probes; no loop got as far as regress.pharn/floor/stage-regress.mjstriesgit worktree addfirst, as before. If it exits non-zero, the stage clears
what it left, makes a fresh base directory in the temp root, and runspharn/floor/base-worktree.mjs
cloneBaseCheckout:git clone --shared --no-checkoutof the repository's top level, then a detached checkout of
the base commit. A local clone writes only its destination, so nothing lands under the project's.git; that is
git's behaviour, and the tests check it (advisory). The clone's git calls run withoutGIT_DIR,GIT_WORK_TREE,
GIT_INDEX_FILEand the other repository-selecting variables. A stage started from a git hook inherits them, and
with them the checkout rewrote the project's HEAD. The branch reads the exit status and never parses git's text, so
the clone also covers anaddthat failed for another reason. If the clone fails too, the stage stopsgit-failed
as before, and the detail names both failures.- When
addsucceeds, no output byte changes. The report gainsbase_checkout: "clone"only when the clone path
ran, afterbase_install, andREGRESSION.mdgains one fixed line. The progress record's optionalbaseCheckout
tells--resumeand cleanup which method made the checkout. A record written before 7.32.0 lacks it and is read as
a worktree, so it still resumes. Cleanup removes a clone's directory, because a clone has no registration. - Both methods put the base commit's top-level tree at the checkout's root, where the base gates run. A clone does not
carry the repository's own.git/config,.git/info/attributesorinfo/exclude. It runs the user's
init.templateDirhooks instead of the project's post-checkout hook. Submodules are not initialized either way.
LFS content and shallow sources are unmeasured. Under the sandbox, a base commit holding a.gitmodulesfile still
fails its checkout.pharn/pharn-contracts/regression-report.mddocuments the key and these bounds. - Measured on a temp copy of this repository (4,329 files, 3 runs):
git worktree addtook 1,236–1,690 ms, and clone
plus checkout took 1,327–1,618 ms. The tests simulate the sandbox's refusal with an unwritable.git/worktrees,
which produces the same git error. That a clone succeeds under the real sandbox is inferred from the record (a
scratch repository used under the temp dir) and has not been re-measured. Reusing the entry gates' base evidence
(6.49.0) was not chosen as the fix, because a miss, or a standalone regress, still needs a checkout.
- 2026-11-30: A measurement record of PHARN 7.29.0 under Claude Code's own Bash sandbox in strict mode (CORE-586):
no-go for shipping a sandbox profile yet, plus the settings block a shipped profile would use. Measured on macOS
27.0.1 with Claude Code 2.1.332, n = 1 per configuration (.dev/measurements/sandbox-probe-2026-11-29.md; kit,
runbook and evidence under.dev/features/sandbox-probe/). In project settings, adenyWriteentry refused Bash
writes topharn/floor/, two of the trusted docs, memory-bank canon andpharn/spec-template.md, and the.claude/
control surface,.git/hooksand.git/configwere refused with no entry. WithallowUnsandboxedCommands: falsethe
unsandboxed retry was ignored.credentialsunset the gate environment's credential names, andcheck-run-isolation
still reportedHOST. Three full/pharn-loopruns (main checkout and linked worktree) all stopped at the entry
gates. One stop was caused by the sandbox: local test servers andtsxcould not bind sockets. Two breaks have no
settings fix:pscannot run, soentry-gates.mjs --abortleaves the gate runner running, andgit worktree addin
the project's repository is refused. Regress, build, verify and the loop commit were not reached. The sandbox covers
Bashonly; the record credits it with no Write-tool, hook or MCP control. No product-surface byte changed.
v7.31.0
Added
- 2026-11-29:
/pharn-reviewrefuses a review target whose files total more than 1 MiB unless the run passes
--allow-large-target, and the assignment record carries that override (CORE-596). Until now nothing bounded the
review set as a whole.render-review-assignments.mjsskipped a discovered file over 512 KiB, but a file named with
--targetwas kept as named, and every scanner-less lens group (hallucinated-api,input-validation,
race-condition,trust-fence) got the whole resolved target, so one large target went into each of those contexts
in full and nobody had chosen that. This changes standalone/pharn-reviewonly, because/pharn-loopdoes not run
it.pharn/floor/render-review-assignments.mjsadds the sizes of the resolved target's files: named files count,
skipped paths do not, and the merge-base-diff branch is capped too. OverMAX_TARGET_TOTAL_BYTES(1 MiB, strictly
greater) it exits 1 and writes nothing. The refusal gives the byte total and the cap, says to narrow the target or
ask the human, and names the flag. With--allow-large-targetthe target is assigned as before, the record gains
total_size_override: {target_bytes, cap_bytes}, and stderr gets one line. The field appears only when the flag
let an over-cap target through, so a target at or under the cap gets the same record, byte for byte, with or
without the flag.- Why 1 MiB: at the ~4 characters per token that
pharn/LIMITS.md §1cuses as an estimate, 1 MiB is about 262k
tokens, which is more than a 200k-token context window. It is also twice the per-file cap. Measured cost: 62 of
this repository's last 300 first-parent commits would have needed the flag or a narrower target, and 3 would have
needed it at 2 MiB. - Over the cap the emitter refuses rather than recording a partial target. Dropping files to fit would mean choosing
them by a rule that has nothing to do with the code, and the record would then present what was left as the
target. The cap is a size rule, not a judgment that any file holds nothing worth reviewing. It limits what is
assigned, never what a lens reads. pharn/floor/check-review-assignments.mjsadds I10: whentotal_size_overrideis present, it must hold exactly
two positive safe integers, withtarget_bytes > cap_bytes. A missing field is valid, so a deleted field looks
the same as a run under the cap, and the sizes are not re-read from disk./pharn-reviewStep 1b now lists three refusals. On the size refusal it asks the human whether to narrow the
target or review all of it, and passes--allow-large-targetonly when the human explicitly answers to review the
whole target. That last part is advisory, because the flag cannot tell who chose it.pharn/LIMITS.md §3asays the same. A person applied that edit before the build anchored, because the trusted
docs are human-only.
v7.30.1
Fixed
- 2026-11-30:
pharn/LIMITS.md§6 and §7 now say whatpharn statusreports from pharn-cli 0.23.0 on: a project
settings file that sets"disableAllHooks": true, and a write guard wired without"onFailure": "block"
(CORE-594). §6 had said that in an install nothing PHARN ships checks either settings file. It now says that
pharn statusprints aHOOKS OFFline for each project file whosedisableAllHooksis exactlytrue, that
pharn status --strictexits 1 on it, and gives the bounds. It reads only.claude/settings.jsonand
.claude/settings.local.json, never~/.claude/settings.json. It judges each file's own value, not the merged
one, and reads neither file under--no-drift. It is a report, not a guard, so a key added after the run is not
seen. §7'sonFailurebullet gains the matchingFAIL-OPENreport, for a hook the shippedsettings.jsonwires
with"onFailure": "block"and a project file wires without it, with the same bounds. TheStophook is never
reported. The text describes a session with no sandbox profile, since PHARN ships none. A human applied the edit
from.dev/features/hook-wiring-flags/proposed/, after rebasing the patch onto 7.29.1 (hunk headers only) and
re-reading its claims at pharn-cliv0.23.0. No guarantee is added to either section.
v7.30.0
Added
- 2026-11-29: A cap on the total size of the always-loaded instruction set (CORE-595). Before this, the
instruction-growthgate limited only how many bytes one change added to the modelled set (CLAUDE.md, its@
imports,.claude/ruleswithoutpaths:). Changes that each stayed under that budget could still pile up: this
repository's ownCLAUDE.mdwent from 97,252 bytes to 186,861 bytes in twelve days in 2026-09/10. Every fresh stage
context pays for this set again (pharn/LIMITS.md§3g).budget.instructionTotalBytesinpharn.config.jsonsets the cap. It is read from the base commit's copy, like
budget.instructionGrowthBytes, so a change cannot raise its own cap. With no key there is no cap, so an
existing install behaves exactly as before. A value that is not a non-negative integer isthreshold-malformed
(exit 2).check-instruction-files.mjs --growthjudges both budgets in one verdict, so/pharn-verify'sinstruction-growth
gate fails when the set's total is over the cap even if the change itself is small. The output now always carries
total_bytes,total_cap,total_cap_source(configorunset) andexceeded(growth,total, both, or
neither).- Stated limits (
pharn/LIMITS.md§3e, edited by a human in this release): the verdict is over the checker's model of
the set, not over what Claude Code loads. A set already over its cap fails every verify until a person raises the
cap or shrinks the set on the base branch;/pharn-loopdoes not check the cap at entry. While a cap is set, a set
that reaches a git submodule issubmodule-unmeasured(exit 2), unless the bytes the checker can read are already
over the cap. Ifpharn updatedrops the key, the cap is off. - This repository sets the cap to 40,960 bytes (
CLAUDE.mdis 31,456 bytes). CI's existing instruction-growth step
applies it to pull requests opened after this one merges.
- 2026-11-29: A proposed
pharn/LIMITS.mdpatch for whatpharn statusreports from pharn-cli 0.23.0 on: a
project settings file that sets"disableAllHooks": true, and a write guard wired without"onFailure": "block"
(CORE-594)..dev/features/hook-wiring-flags/proposed/holds the patch and itsAPPLY.md, which maps each new
claim to the pharn-cli source line behind it. The patch rewrites §6's "nothing PHARN ships checks either file" and
adds a passage to §7'sonFailurebullet, stating the report's bounds there. Nothing is applied: pharn-cli 0.23.0
is not published yet, andAPPLY.mdsays to wait for it. No shipped file changes, soSKILLS_VERSIONstays
7.29.1.
v7.29.1
Fixed
- 2026-11-29:
pharn/LIMITS.md§3g now gives the measured size of apharn-stagefirst request (CORE-598). It
had said that how much smaller apharn-stagefirst request is than ageneral-purposeone "is not measured in
this document". The 2026-11-23 benchmark measured it: 33,011 tokens against 60,207 (the plan and grill agents),
with the same project instruction files and memory index in both, so the first request is 45.2% smaller.
§3g now cites.dev/measurements/stage-agent-benchmark-2026-11-23.md§4 and states the record's bounds: n = 1
per arm, one project, a one-line doc-comment feature, Claude Code 2.1.328. A human applied the edit from
.dev/features/limits-stage-prefix-pointer/proposed/. The figure covers the first request only. It is not a
guarantee and gives no mean or spread.
Added
- 2026-11-29: A measurement record of the orchestrator's share in the green 7.22.0
/pharn-looprun, set against
CORE-113's reopening threshold (CORE-597)..dev/measurements/orchestrator-share-7.22.0-2026-11-29.mdre-derives
two readings with the baseline's weighted-cost formula. Run 2'scost.json(the run window) gives 26.95% (36 of 138
requests), and the whole session's transcript gives 36.48% (46 of 148). The reopening condition namescost.json, so
this run does not meet condition 1 (27.7%), at n = 1. The record does not reopen CORE-113. The ticket's whole-session
range, 31.0%–33.4%, is not a bound: it weighted every cache write alike, while the orchestrator wrote only 1-hour
cache and the stage agents only 5-minute cache. The commands live in
.dev/features/orchestrator-share-record/share.mjs. Build apparatus only: no product byte, noSKILLS_VERSIONbump.