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): accept a +json suffix only on application media t…
…ypes

Addresses the fourth automated review round: `image/example+json` or
`text/example+json` no longer counts as JSON for origin selection, exclusion
or body shapes, matching the documented `application/json` and
`application/*+json` contract.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
  • Loading branch information
earakely-scale and claude committed Oct 18, 2026
commit 2679323e78b6c5577bbb773010b0192c8e648b71
6 changes: 5 additions & 1 deletion src/domain/analysisView/EnvironmentManifestAccumulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@ const UNKNOWNS: Manifest["unknowns"] = [
},
];

/** `application/json` or `application/*+json`; a `+json` suffix on another type is not JSON here. */
const isJson = (essence: string | null): boolean =>
essence === "application/json" || (essence?.endsWith("+json") ?? false);
essence === "application/json" ||
(essence !== null &&
essence.startsWith("application/") &&
essence.endsWith("+json"));

const isJsonLike = (essence: string | null): boolean =>
isJson(essence) || (essence !== null && JSON_LIKE_TEXT.has(essence));
Expand Down
29 changes: 29 additions & 0 deletions src/domain/analysisView/environmentManifestView.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -895,3 +895,32 @@ it("folds many literal siblings into one opt-in parameter", () => {
expect(projected.tools).toHaveLength(1);
expect(projected.tools[0]?.params[0]?.observed_values).toHaveLength(301);
});

it("treats a +json suffix as JSON only on application media types", () => {
const projected = manifest(
[],
syntheticCapture([
["GET", "https://s.test/api/items", "application/vnd.api+json"],
["GET", "https://s.test/gallery/1", "image/example+json"],
["GET", "https://s.test/notes/1", "text/example+json"],
[
"POST",
"https://s.test/api/items",
"application/json",
'{"title":"t"}',
"text/example+json",
],
]),
);
expect(projected.tools.map(line)).toEqual([
"GET /api/items",
"POST /api/items",
]);
expect(
projected.excluded.map((entry) => [entry.path_template, entry.reason]),
).toEqual([
["/gallery/{numeric}", "ui-page-or-asset"],
["/notes/{numeric}", "non-json"],
]);
expect(projected.tools[1]?.body_shape).toBeNull();
});
Loading