Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
61d3536
feat(analysis-view): project an environment manifest from web network…
earakely-scale Oct 18, 2026
2d95597
test(web-network): check the manifest refusal text like the api-surfa…
earakely-scale Oct 18, 2026
6cb38b5
docs(specs): record the hosted web-network lane run for the manifest …
earakely-scale Oct 18, 2026
b6d18d2
docs(specs): reconcile the manifest view verification scope note with…
earakely-scale Oct 18, 2026
44203ec
fix(analysis-view): bound body, route and name work in the environmen…
earakely-scale Oct 18, 2026
bfe5a36
fix(analysis-view): keep manifest folding, naming and media-type read…
earakely-scale Oct 18, 2026
71d7513
fix(analysis-view): charge the manifest group key before building it
earakely-scale Oct 18, 2026
2679323
fix(analysis-view): accept a +json suffix only on application media t…
earakely-scale Oct 18, 2026
692453b
chore: merge main into environment manifest review
gensokyo-dev Oct 18, 2026
f73af11
fix(analysis-view): require the capture parent's exact subject for a …
earakely-scale Oct 18, 2026
d6cb57e
fix(analysis-view): share truncated suffix allocation work
gensokyo-dev Oct 18, 2026
99be275
chore: incorporate environment manifest review updates
gensokyo-dev Oct 18, 2026
dd87f54
fix(analysis-view): merge only identifier-like siblings under sibling…
earakely-scale Oct 18, 2026
ef47ead
chore: update environment manifest review from main
gensokyo-dev Oct 18, 2026
252b55d
fix(analysis-view): combine qualifying sibling cohorts
gensokyo-dev Oct 18, 2026
f2c3456
chore: refresh environment manifest validation from main
gensokyo-dev Oct 18, 2026
adbbbe5
docs(analysis-view): clarify opt-in sibling folding
gensokyo-dev Oct 18, 2026
494e015
chore: merge main (d1adc607) into the environment manifest view branch
earakely-scale Oct 18, 2026
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
Prev Previous commit
Next Next commit
fix(analysis-view): charge the manifest group key before building it
Addresses the third automated review round: the composite key copies the
method, origin, template and rules, so that copy is reserved before the key
is stringified.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
  • Loading branch information
earakely-scale and claude committed Oct 18, 2026
commit 71d7513c478c722fbb2026d7ff7d9a5025dbd190
12 changes: 12 additions & 0 deletions src/domain/analysisView/EnvironmentManifestAccumulator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,15 @@ it("charges a request media type before scanning it so an oversized one fails cl
});
expect(finished(accumulator).tools).toHaveLength(0);
});

it("charges the group key before building it so an oversized request method fails closed", () => {
const accumulator = new EnvironmentManifestAccumulator(64 * 1024);
const record = sample(0, "/api/items");
(record.reported as { request: { method: string } }).request.method =
`GET${"X".repeat(100_000)}`;
expect(accumulator.add(record)).toMatchObject({
ok: false,
error: { _tag: "AnalysisResourceConstraintError", resource: "memory" },
});
expect(finished(accumulator).tools).toHaveLength(0);
});
16 changes: 15 additions & 1 deletion src/domain/analysisView/EnvironmentManifestAccumulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ const ASSET_PREFIXES = ["image/", "font/", "audio/", "video/"];
const ASSET_PATH =
/\.(?:m?js|css|map|html?|png|jpe?g|gif|svg|webp|ico|woff2?|ttf|otf)$/iu;
const WRITE_METHODS = new Set(["POST", "PUT", "PATCH"]);
/** Quotes, separators and brackets a four-part composite key adds around its texts. */
const KEY_OVERHEAD_CHARS = 32;
const UNKNOWNS: Manifest["unknowns"] = [
{
kind: "authorization-model",
Expand Down Expand Up @@ -211,13 +213,25 @@ export class EnvironmentManifestAccumulator extends WebNetworkProjectionAccumula
if (route === null) return this.overBudget();
const queryNames = readQueryParameterNames(line.query, this.scratch);
if (queryNames === null) return this.overBudget();
// The key copies the method, origin, template and rules; charge that copy before it exists.
if (
!this.scratch(
textBytes(
line.method.length +
line.origin.length +
route.template.length +
route.rules.length +
KEY_OVERHEAD_CHARS,
),
)
)
return this.overBudget();
const key = compositeKey([
Comment thread
gensokyo-dev marked this conversation as resolved.
Resolved
line.method,
line.origin,
route.template,
route.rules,
]);
if (!this.scratch(textBytes(key.length))) return this.overBudget();
const group = this.#groups.get(key);
const bodyShape =
group === undefined && WRITE_METHODS.has(line.method)
Expand Down
Loading