Skip to content

Commit 0e5e054

Browse files
committed
feat(pm): declare COMMENT_BODY_LIMIT beside ISSUE_BODY_LIMIT, from its own bisection
The comment surface was bisected on objectstack#18826 to the same 262,144 bytes the issue-body surface was bisected to on #18793 — two surfaces, two brackets, one number — and post-stamped needs the comment one to name the cap in a size refusal. It is declared here rather than in post-stamped because this is already where this fleet's measured body caps live: five workflow comments send a reader to `ISSUE_BODY_LIMIT` in this file for the number, and the 65,536 folklore this pair replaces grows back wherever one of two caps is kept somewhere else. ⛔ Two constants and not one shared number: two measurements that agree is not one measurement, and the day the platform moves one surface a shared number would lie about the other. The docblock-anchored provenance pins of the `ISSUE_BODY_LIMIT measured cap` battery are extended to the sibling, including the control that each provenance cites only the probe that measured it. Claude-Session: https://claude.ai/code/session_01BTeBejoPUvRHN8WdAJC6oF Co-authored-by: Claude <noreply@anthropic.com>
1 parent ea067ff commit 0e5e054

2 files changed

Lines changed: 68 additions & 28 deletions

File tree

‎scripts/pm/check-half-states.mjs‎

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17256,6 +17256,46 @@ export const OUTPUT_FORMATS = ['plain', 'markdown'];
1725617256
export const ISSUE_BODY_LIMIT = 262144;
1725717257
export const MARKDOWN_BODY_BUDGET = 60000;
1725817258

17259+
/**
17260+
* The largest COMMENT body the platform stores, in the same unit: UTF-8 BYTES.
17261+
*
17262+
* The sibling surface, bisected separately. `post-stamped.mjs` imports this to
17263+
* name the cap in a size refusal, and it is declared HERE rather than there
17264+
* because this file is already where this fleet's measured body caps live: five
17265+
* workflow comments send a reader to `ISSUE_BODY_LIMIT` in this file for the
17266+
* number, and the 65,536 folklore this pair replaces is the kind that grows back
17267+
* wherever one of two caps is kept somewhere else.
17268+
*
17269+
* Bisected on a throwaway probe opened for it (objectstack#18826, 2026-09-17),
17270+
* twelve measurement writes, every one read back byte-exact:
17271+
*
17272+
* 262,144 bytes STORED (read-back class `identical`)
17273+
* 262,145 bytes REFUSED (HTTP 422, nothing written)
17274+
*
17275+
* ⭐ The same value as `ISSUE_BODY_LIMIT`, reached by a SECOND, independent
17276+
* bisection — two surfaces, two brackets, one number: 256 KiB exactly. ⛔ And
17277+
* therefore two constants and not one: two measurements that agree is not one
17278+
* measurement, and the day the platform moves one surface a shared number would
17279+
* lie about the other.
17280+
*
17281+
* ⛔ The unit is measured here too. A comment of 262,145 bytes carrying only
17282+
* 222,145 characters (a run of 3-byte U+4E2D plus ASCII padding) was REFUSED —
17283+
* a cap counted in characters, or in UTF-16 code units, would have taken it with
17284+
* 40,000 to spare — and the same multi-byte shape at 262,144 bytes / 222,144
17285+
* characters STORED.
17286+
*
17287+
* ⚠️ What the two surfaces do NOT share is the SHAPE of the refusal. Over the
17288+
* cap, a comment create answers a real HTTP 422 and writes nothing, while an
17289+
* issue-body update refuses SILENTLY — 200, the old body kept, nothing reported
17290+
* (#18793). `post-stamped.mjs` carries one exit code for each.
17291+
*
17292+
* ⛔ And the platform's own 422 text says `maximum is 65536 characters`, which
17293+
* is false in unit AND value: write 3 of that probe stored a 65,537-character
17294+
* comment and write 4 a 262,144-byte one, four times the claimed maximum. ⛔
17295+
* Nothing here is derived from that sentence.
17296+
*/
17297+
export const COMMENT_BODY_LIMIT = 262144;
17298+
1725917299
/**
1726017300
* A body's size as the PLATFORM counts it: UTF-8 bytes.
1726117301
*
@@ -24375,7 +24415,7 @@ export const SELF_TEST_BATTERIES = Object.freeze({
2437524415
// docblock — unit, both sides of the bracket, the date and the probe issue —
2437624416
// because a number with no provenance is what got re-derived from memory the
2437724417
// first time.
24378-
'ISSUE_BODY_LIMIT measured cap': 37,
24418+
'ISSUE_BODY_LIMIT measured cap': 52,
2437924419
});
2438024420

2438124421
/** The floor on the ROSTER itself — how many batteries must be declared at all. */
@@ -28559,6 +28599,32 @@ async function selfTest() {
2855928599
b(BATTERY18664, '#18664 cap: ⛔ the retired 65,536 is gone', ISSUE_BODY_LIMIT === 65536, false);
2856028600
b(BATTERY18664, '#18664 cap: …and the measured cap is four times it', ISSUE_BODY_LIMIT === 65536 * 4, true);
2856128601

28602+
// #18843: the COMMENT surface's cap, declared beside its sibling. Pinned in
28603+
// THIS battery because what the battery floors is a measurement and its unit,
28604+
// and the sibling is the same measurement on the other surface — ⛔ not in a
28605+
// battery of its own, which would leave the name-roster pin below describing
28606+
// a ledger it no longer covers.
28607+
const commentCapDocblock = (() => {
28608+
const at = selfSource.indexOf('\nexport const COMMENT_BODY_LIMIT =');
28609+
const open = at < 0 ? -1 : selfSource.lastIndexOf('/**', at);
28610+
return at < 0 || open < 0 ? '' : selfSource.slice(open, at);
28611+
})();
28612+
b(BATTERY18664, '#18843 provenance: ⭐ the extractor really found the comment cap\'s own docblock', commentCapDocblock.startsWith('/**') && commentCapDocblock.endsWith('*/'), true);
28613+
b(BATTERY18664, '#18843 provenance: ⛔ …and not the whole file, which would satisfy every pin below with its own text', commentCapDocblock.includes('export const'), false);
28614+
b(BATTERY18664, '#18843 provenance: the docblock names the UNIT', commentCapDocblock.includes('UTF-8 BYTES'), true);
28615+
b(BATTERY18664, '#18843 provenance: …the landed side of the bracket', commentCapDocblock.includes('262,144 bytes STORED'), true);
28616+
b(BATTERY18664, '#18843 provenance: …the refused side, one byte up', commentCapDocblock.includes('262,145 bytes REFUSED'), true);
28617+
b(BATTERY18664, '#18843 provenance: …the date it was taken', commentCapDocblock.includes('2026-09-17'), true);
28618+
b(BATTERY18664, '#18843 provenance: …the issue it was measured on', commentCapDocblock.includes('objectstack#18826'), true);
28619+
b(BATTERY18664, '#18843 provenance: …and that THIS surface refuses LOUDLY, which the issue body does not', commentCapDocblock.includes('HTTP 422'), true);
28620+
b(BATTERY18664, '#18843 cap: the comment cap is the bisected value', COMMENT_BODY_LIMIT, 262144);
28621+
b(BATTERY18664, '#18843 cap: …which is 256 KiB exactly, checkable by hand', COMMENT_BODY_LIMIT === 256 * 1024, true);
28622+
b(BATTERY18664, '#18843 cap: ⛔ the retired 65,536 is gone here too', COMMENT_BODY_LIMIT === 65536, false);
28623+
b(BATTERY18664, '#18843 cap: …and the measured cap is four times it', COMMENT_BODY_LIMIT === 65536 * 4, true);
28624+
b(BATTERY18664, '#18843 pair: ⭐ the two surfaces agree — two bisections, one number', COMMENT_BODY_LIMIT === ISSUE_BODY_LIMIT, true);
28625+
b(BATTERY18664, '#18843 pair: ⛔ …and each stands on its OWN probe, so neither provenance borrows the other\'s', capDocblock.includes('objectstack#18793') && capDocblock.includes('objectstack#18826') === false, true);
28626+
b(BATTERY18664, '#18843 pair: ⛔ …the comment one likewise cites only the probe that measured it', commentCapDocblock.includes('objectstack#18793') === false, true);
28627+
2856228628
// The unit, at the primitive the guard is built on.
2856328629
b(BATTERY18664, '#18664 unit: bodyBytes counts UTF-8 bytes', bodyBytes('\u4e2d'), 3);
2856428630
b(BATTERY18664, '#18664 unit: …where `.length` calls the same character one', '\u4e2d'.length, 1);

‎scripts/pm/post-stamped.mjs‎

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ import { readFileSync } from 'node:fs';
658658
import { fileURLToPath } from 'node:url';
659659
import { isEntrypoint } from '../invoked-as.mjs';
660660
import {
661+
COMMENT_BODY_LIMIT,
661662
EXIT_PREREQUISITE_NOT_MET,
662663
H56_STAMP_TOLERANCE_MIN,
663664
ISSUE_BODY_LIMIT,
@@ -674,33 +675,6 @@ const SELF_PATH = fileURLToPath(import.meta.url);
674675
const API = 'https://api.github.com';
675676
const TOKEN = process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN ?? '';
676677

677-
/**
678-
* The largest comment body the platform STORES, in the unit it refuses in:
679-
* UTF-8 BYTES.
680-
*
681-
* Bisected on a throwaway probe opened for it (objectstack#18826,
682-
* 2026-09-17), twelve measurement writes, every one read back byte-exact:
683-
*
684-
* 262,144 bytes STORED (read-back class `identical`)
685-
* 262,145 bytes REFUSED (HTTP 422, nothing written)
686-
*
687-
* ⭐ The same value as `ISSUE_BODY_LIMIT`, reached by a SECOND, independent
688-
* bisection — two surfaces, two brackets, one number: 256 KiB exactly.
689-
*
690-
* ⛔ The unit is measured, not assumed. A body of 262,145 bytes carrying only
691-
* 222,145 characters (a run of 3-byte U+4E2D plus ASCII padding) was REFUSED —
692-
* a cap counted in characters, or in UTF-16 code units, would have taken it
693-
* with 40,000 to spare — and the same multi-byte shape at 262,144 bytes /
694-
* 222,144 characters STORED.
695-
*
696-
* ⛔ And the platform's own 422 says `maximum is 65536 characters`, which is
697-
* false in unit AND value: write 3 of that probe stored a 65,537-character
698-
* comment and write 4 stored a 262,144-byte one, four times the claimed
699-
* maximum. That string is the likely provenance of the 65,536 folklore this
700-
* fleet has already had to correct once, so ⛔ nothing here is derived from it.
701-
*/
702-
export const COMMENT_BODY_LIMIT = 262144;
703-
704678
export const EXIT_OK = 0;
705679
export const EXIT_USAGE = 1;
706680
export const EXIT_REFUSED = 2;

0 commit comments

Comments
 (0)