You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
2026-11-29: /pharn-review refuses 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.mjs skipped a discovered file over 512 KiB, but a file named with --target was 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-review only, because /pharn-loop does not run
it.
pharn/floor/render-review-assignments.mjs adds the sizes of the resolved target's files: named files count,
skipped paths do not, and the merge-base-diff branch is capped too. Over MAX_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-target the 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 §1c uses 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.mjs adds I10: when total_size_override is present, it must hold exactly
two positive safe integers, with target_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-review Step 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-target only 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 §3a says the same. A person applied that edit before the build anchored, because the trusted
docs are human-only.