Date: 2026-10-06 Scope: Group a site’s crawled pages into page types (templates). Choose the pages a run inspects by type, not by crawl order. Standard covers one page of every type up to a cap instead of the first 5 pages; Comprehensive covers every type first. The report names the types found, covered and skipped, with each page’s full URL. A list of URLs pasted into the URL field re-runs exactly those pages. Status: Complete 2026-10-07 (Gate B passed, Emil). Locked 2026-10-07. Emil asked for it on 2026-10-06 and decided that Standard is not capped at 5 pages; on 2026-10-07 he confirmed the remaining values: a cap of 8, exact structural signatures instead of an outline threshold, ordered ranking rules instead of weights, the keep rule in Decision 9, and Phase 40 before Phase 39. TFP-167 and TFP-154’s re-score are done (9 found, 4 hinted, 24 missed). Tickets TFP-170 to TFP-176. Revised at Gate A on 2026-10-07: Decisions 1, 2 and 4 (address first, a hard cap).
MAX_INSPECTION_PATHS (5) pages in crawl order. On practicesoftwaretesting.com
that is home, the three sign-in pages and one category (TFP-150, TFP-154
step 1). Product, contact and rentals pages are never opened, though most
of the site’s pages are products.:id (/product/01HX… →
/product/:id), and slugs under a shared parent become :slug
(/category/hand-tools → /category/:slug)./#/product/:id)./contact, /privacy); the root is
not a shared parent (Emil, 2026-10-07, TFP-170’s review).:id is a collection name, not a slug
(Emil, 2026-10-07, Gate A): /en/product/1 and /en/category/2 are
/en/product/:id and /en/category/:id, not one /en/:slug/:id.d8287a1) showed that merging any address types with equal
signatures merges unrelated templates (90 of the-internet’s 100 pages
into one type with home; Toolshop products with /rentals and
/privacy), and that splitting on cards follows data, not templates
(products with and without related items; an empty category).
/auth/:slug into login, register and
forgot-password). Landmarks and cards don’t split a type.:id and :slug are applied:
/p/:id and /p/:slug share /p and merge. Clarified at Gate A’s
re-check (Emil, 2026-10-07): not the same first segment. Under a
first-segment reading, every page of a site with a language prefix
(/en/...) or an app under one path (/app/...) is one section, so
unrelated templates merge again whenever their outlines match
(/en/product/:id with /en/category/:id). A wrong merge silently
skips a template, while a wrong split costs only a cap slot, so merging
stays the narrow side. The earlier /shop/men/shirts +
/shop/women/shoes example is withdrawn: they have different parents
and stay two types./privacy + /terms example is withdrawn: two
content types cost little, since content types are dropped first.MAX_INSPECTION_PATHS (5)”) becomes “the
selected pages”.https://with-bugs.practicesoftwaretesting.com/#/product/1)./#/contact) are kept as they are (TFP-165).878a49d):
9 found, 4 hinted, 24 missed of 37.TEST_PLAN.md cases for the grouping, the outline merge and split,
the ranking’s always-covered rule, the cap with named skips, Comprehensive
coverage, the report, the re-run list round trip, the multi-URL field
(including the other-origin rejection) and the override.check:template-unchanged on the 166 fixed inputs: test bodies are
unchanged. Only which pages a suite covers changes, and the fixed inputs
name their pages directly.Ticket prefix TFP-. Every ticket stops for independent verification (Cowork) before the next starts. New tests name the ISTQB technique they use.
crawl, selection:id or :slug; query strings
ignored; hash-routed pages grouped by TFP-165’s page names;/product/01HX… pages group as /product/:id, /category/hand-tools
and its siblings as /category/:slug, and /#/product/1 and its
siblings as /#/product/:id;Moved word for word from docs/test-plan/GEN.md by TFP-253; the case’s row there links here.
Test: A site’s crawled pages are grouped into types by address pattern (TFP-170, Phase 40 Decision 1; unit: src/lib/selection/page-types.test.ts (unit cases, the two committed Toolshop crawls, and a real crawl of the fixture’s /spa through /api/crawl))
Expected result: Grouping (src/lib/selection/page-types.ts): a segment that is an identifier (digits, a UUID, a ULID or other letter-and-digit token of 16+ characters, hex of 8+ with a digit) becomes :id; a segment that varies between addresses equal everywhere else, under a parent segment, becomes :slug; top-level pages and a lone child stay literal; hash routes group by TFP-165’s page names (/#/product/:id, /app#!/item/:id); a query string doesn’t create a type. Types keep crawl order. The crawl (/api/crawl) records them as pageTypes (pattern and pages, from the pages in discovery order). Proven (equivalence partitioning: ids, slugs, top-level pages, hash routes, queries), 2026-10-07: /product/01M48... groups as /product/:id; /category/hand-tools and its siblings as /category/:slug; /#/product/1 and siblings as /#/product/:id; /search?q=a and /search?q=b are one type; /contact, /privacy, /rentals stay three types. The committed Toolshop crawls give 7 types each, the same patterns apart from the sites’ own pages: clean / 1, /auth/:slug 3, /category/:slug 4, /contact 1, /privacy 1, /product/:id 35, /rentals 1; with-bugs the same under /# with /#/category/:slug 3, /#/product/:id 24, /#/chainsaws 1 and no /privacy. A real crawl of /spa records 6 types. Not yet: /auth/:slug groups the sign-in, registration and forgot-password pages by address; Decision 2’s outline (TFP-171) is what splits them.
crawl, selection, measurementd8287a1, verified 2026-10-07 (Cowork); Gate A not passed.
The counts in benchmarks/2026-10-07-phase40-types/ reproduce from the
committed type files. Exact matching under-splits across address types
and over-splits on cards; Emil revised Decisions 1, 2 and 4 the same day.
TFP-176 builds the revision.Moved word for word from docs/test-plan/GEN.md by TFP-253; the case’s row there links here.
Test: Each page’s outline refines its address type: equal structural signatures merge, different ones split; each type gets a report-only label (TFP-171, Phase 40 Decisions 2 and 3; unit: src/lib/selection/page-outline.test.ts (unit cases, then a real crawl of the fixture’s /types shop through /api/crawl); fixture: /types, /p/..., /shop/...)
Expected result: Outline (src/lib/selection/page-outline.ts, read by the crawl from the page it already has open): landmark regions (banner, navigation, main, complementary, contentinfo, search), forms and each form’s field types, repeated card-like items (3+ siblings of one tag and class, each a link with an image or heading), heading levels and the interactive-element count. Signature: landmarks, forms (count and field types) and cards; headings and counts never decide. Field types are every field’s type: Decision 2 names password, email, textarea and search, and read as the whole list a registration form and a sign-in form (both email and password) would match. Grouping (groupPagesIntoTypes): TFP-170’s address types split by signature, then types of different patterns with equal signatures merge (/legal/privacy + /help/terms); a page with no outline keeps its address type. Labels (report only, never change pages): home, sign-in (a password field), detail (an :id pattern), listing (repeated cards), form, search (only type="search" fields), content (no forms, no cards), other. The crawl records each page’s outline and the labelled types as pageTypes. Proven (equivalence partitioning over how two pages relate: same address and signature, same address different signature, different address same signature, a page with no outline), 2026-10-07: the /types crawl finds exactly 9 types from 14 pages: home; /types/product/:id (101, 102) and, split off by its outline, 103; /types/category/:slug; /types/account/:slug split into sign-in (login) and form (contact), as the Toolshop’s /auth/:slug; /types/legal/privacy + /types/help/terms merged; and TFP-170’s edges folded back: /p/:id + /p/:slug and /shop/men/shirts + /shop/women/shoes. A deliberately wrong label leaves every type’s pages unchanged. Found: under a shared prefix two id families read as one slug pattern (/en/product/1, /en/category/2 -> /en/:slug/:id, TFP-170’s rule); their outlines split them, but both keep that name. Measured (benchmarks/2026-10-07-phase40-types/): types (address types) - fixture 3 (3), /types 9 (10), Toolshop clean 9 (7), with-bugs 9 (7), the-internet 9 (57, 100 pages). The Toolshop’s /auth/:slug splits into its three pages on both sites (under the narrow reading of field types it doesn’t on with-bugs). Exact matching under-splits where pages share few landmarks, forms or cards (the-internet: 90 pages in home’s type; Toolshop products without related items merge with /rentals and /privacy) and over-splits a little (empty categories; products with and without related items). For Gate A.
selection, measurement:id is never a slug;/types fixture updated to the
revised expectation, /en/product/:id beside /en/category/:id, the
two TFP-170 edge families still merging, and a page without cards kept
in its listing type;benchmarks/2026-10-07-phase40-types/ (no new crawl), with a section
added to that report beside the first measurement, which stays./#/chainsaws in place of /privacy;
any difference is explained in the report;check:template-unchanged 166 of 166 identical.b9270b2, verified 2026-10-07 (Cowork), with one correction.
Re-running the grouping on the committed crawls reproduces every count:
both Toolshops give exactly the 9 expected types, the-internet 57, the
/types fixture 9. But b9270b2 reads “same parent” as “same first
segment and depth”, which merges /en/product/:id with
/en/category/:id (and /a/b/c/x with /a/d/e/y) when their outlines
match. Emil clarified Decision 2 the same day: the immediate parent.
/p/:id + /p/:slug merge;
/shop/men/shirts and /shop/women/shoes stay apart; /en/product/:id
and /en/category/:id stay apart even with equal outlines; a top-level
page and home never merge. Update the /types fixture’s expectation
(/types/help/terms and /types/legal/privacy no longer merge).8c05578, verified 2026-10-07 (Cowork). Re-running
the grouping on the committed crawls: /en/product/:id and
/en/category/:id stay apart, as do /a/b/c/x and /a/d/e/y and the
two /shop pages; /p/:id + /p/:slug still merge; top-level pages
never merge. The /types fixture gives 11 types. Both Toolshops (9 types
each) and the-internet (57) are identical to the second measurement, type
for type.Moved word for word from docs/test-plan/GEN.md by TFP-253; the case’s row there links here.
Test: The page grouping as revised at Gate A: address types first, split only by form signature, merge only siblings under one immediate parent, never top-level pages or home; no slug before an :id (TFP-176 and its follow-up, Phase 40 Decisions 1, 2 and 4 revised by owner decision, 2026-10-07; unit: src/lib/selection/page-outline.test.ts (decision table, then a real crawl of the fixture’s /types shop))
Expected result: Address (groupPagesByAddress): a segment directly before an :id names a collection and is never a slug (/en/product/1, /en/category/2 stay /en/product/:id, /en/category/:id). Split: an address type splits only when its pages’ form signatures (formSignatureOf: how many forms, each one’s field types) differ; landmarks and cards don’t split. Merge: only address types under one immediate parent (the pattern minus its last segment, prefix kept: /p/:id and /p/:slug merge; /shop/men/shirts and /shop/women/shoes don’t, nor /en/product/:id and /en/category/:id, even with equal outlines; the owner clarified 2026-10-07) whose pages share one full signature; top-level pages and home never merge; a page with no outline stays apart and never merges. Proven (decision table: same address or not, form signatures, full signatures, same immediate parent or not, outline read or not), 2026-10-07: the /types crawl (15 pages) gives 11 types: /types/product/:id split by forms, the empty category kept with the listing, /types/account/:slug split into sign-in and form, /types/legal/privacy and /types/help/terms apart, /shop/men/shirts and /shop/women/shoes apart, /p/:id + /p/:slug merged; /, /privacy, /terms never merge, nor /#/rentals and /#/chainsaws. Re-measured from the committed crawls (benchmarks/2026-10-07-phase40-types/, remeasure-tfp176.mts): Toolshop clean 9 types (home, category 4, product 35, contact, rentals, privacy, login, register, forgot-password), with-bugs the same with /#/chainsaws for /privacy (category 3, product 24); the-internet 57 types (its examples are top-level), forms on /checkboxes, /dynamic_controls, /forgot_password, /key_presses, /login, /upload. Under the immediate-parent rule (--out=tfp176-parent) all three sites’ results are byte-identical; only the /types fixture changes, 9 to 11.
selection, generatecheck:template-unchanged shows test
bodies unchanged on the 166 fixed inputs.Dependencies: TFP-171 and Gate A.
10c3f8c, verified 2026-10-07 (Cowork), with one follow-up.
Re-running the ranking and selection on the committed crawls reproduces
the report: each Toolshop’s Standard covers 8 of 9 types and skips its
rentals page (content, by crawl order), naming the rule; the-internet’s
Standard covers its 8 always-covered types and names 49 skipped;
Comprehensive covers all 9 Toolshop types in 20 pages.
/#/product/10 on with-bugs), not the
hand-picked list’s /#/product/1. If a product bug shows only on one
product, the keep rule will show it.967ad6c, verified 2026-10-07 (Cowork): home now
leads the ranking (first on the-internet, where it was 8th), with a unit
case of home behind 9 form types under the cap of 8. Covered pages on the
committed crawls are unchanged; only the order moves.Moved word for word from docs/test-plan/GEN.md by TFP-253; the case’s row there links here.
Test: Page types are ranked and Standard covers one page per type up to a hard cap of 8 (TFP-172, Phase 40 Decisions 4 and 5 as revised at Gate A; unit: src/lib/selection/select.test.ts (decision table), plus the real crawl in src/lib/selection/page-outline.test.ts)
Expected result: Always covered: home, every type with a form, the largest type; home is always ranked first (Decision 4 amended 2026-10-07, TFP-172’s follow-up); then the ordered rules (more pages, more forms on the representative page, more interactive elements on it, crawl order), no weights; content types last. The cap is hard: always-covered types beyond it (after home) are ordered by the same rules and skipped, named; home is never cut. Representative page: most interactive elements, ties to crawl order. Each type records the rule that placed it, and each skip says so in one line. A run inspects the selected pages (Phase 38 Decision 4’s reach; the 5-page cap is gone, bounded at 100); the UI selects by type after a crawl, follows the run type until the user picks by hand, and “Select by page type” returns to it. Proven 2026-10-07: decision table (home, form, largest, content; within or over the cap; always-covered alone over it, with home still covered first); the committed Gate A crawls: both Toolshops cover 8 of 9 types and skip /rentals (/#/rentals), a content type; the-internet covers its 8 always-covered types, home first, and skips 49; the /types fixture crawl covers 8 of 11, skipping sold-out product 103 and the two content pages.
Moved word for word from docs/test-plan/GEN.md by TFP-253; the case’s row there links here.
Test: Comprehensive covers every page type before a second page of any (TFP-172, Phase 40 Decision 6; unit: src/lib/selection/select.test.ts)
Expected result: One page (the representative) of every type in rank order; types beyond the budget are skipped, named. The rest of the budget (the run’s page cap, 20 by default) goes one more page per type per round, in rank order, each type’s pages by most interactive elements, until the budget or the pages run out. Proven 2026-10-07: a 4-type site with budget 7, 2 and 20; both Toolshops cover all 9 types in 20 pages.
reportDependencies: TFP-172.
1e7fcd1, verified 2026-10-07 (Cowork), with one fix carried
into TFP-174. The app’s report and both HTML exports end with the
section: types found, covered and skipped, each with pattern, page count,
label and representative URL; the covered list, then one page per skipped
type. A hand selection is recorded as an override (pages added and left
out). The record reaches the run through the generation record, which
/api/run normalizes as untrusted input, and the HTML export escapes it.
href, so a javascript: value would survive into a shared
HTML file. TFP-174 accepts only http: and https: URLs on the run’s
origin, here as in the URL field, and drops the rest.Moved word for word from docs/test-plan/RPT.md by TFP-253; the case’s row there links here.
Test: The run report shows coverage by page type and ends with the copyable re-run lists (TFP-173, Phase 40 Decision 7; unit: src/lib/selection/coverage.test.ts, src/lib/run/jobs.test.ts; UI: tests/regression/testforge.page-types.spec.ts)
Expected result: When the pages came from a crawl, the generation record carries the page types found, covered and skipped, each with pattern, page count, label and the full URL of the page that represented it, as the address bar shows it (https://…/#/product/1); skipped types give their one-line reason. A selection made by hand is recorded as an override: the pages added to and left out of the type selection, and each skipped type says whether the type selection would have covered it. The app’s report and both HTML exports (Standard and Comprehensive) show the section last: Decision 7’s sentence (“Found 9 page types. Covered 8: home, detail (3 pages), … Not covered: content (rentals).”), the table, the covered pages one per line (with a copy button in the app), then the skipped types’ pages. /api/run normalizes the record as untrusted input (unknown selector or run type dropped; at most 100 types and 100 URLs). Without a crawl there is no section. Proven 2026-10-07: decision table (by type or by hand; Standard or Comprehensive; covered, skipped or added; hash routes); the normalizer round trip; a finished job’s report carries the record; both exports end with the lists; through the UI, a crawl of the /types shop runs 8 pages and the report names 11 types, 3 skipped; “Select all” is sent as an override with 7 pages added, and “Select by page type” returns to 8.
ui, apiurl, covered, and the override’s added and removed) keep
only http: and https: URLs on the run’s origin; anything else is
dropped when /api/run normalizes the record. A unit case shows a
javascript: URL and an other-origin URL dropped, and the HTML export
never contains them.Dependencies: TFP-173.
e2a3070, verified 2026-10-07 (Cowork), with one follow-up.
The field parses one URL as before, or a list on one origin (checked by
URL.origin, so https://site@evil is rejected); javascript: and
data: are rejected; the page-type record keeps only http:/https:
URLs on the run’s origin.
/api/introspect or /api/generate as a path
such as //evil.test/x or /\evil.test/x passes findForeignPath
(it isn’t an absolute URL) but resolves to another site in the
inspector (new URL(path, baseUrl)). This predates TFP-174, but
Decision 8’s guarantee depends on closing it. Follow-up: resolve
every page against the base URL and reject any whose origin differs,
before the run, naming it; unit cases for both forms.tests/regression/testforge.journeys.spec.ts:133) still expects
“Blocked”, but skipped tests have been reported as “Not run” since
de26bf1. Fix the assertion in its own test commit.Moved word for word from docs/test-plan/GEN.md by TFP-253; the case’s row there links here.
Test: The URL field takes a list of pages (TFP-174, Phase 40 Decision 8, with TFP-173’s review; unit: src/app/_lib/derive.test.ts, src/lib/selection/coverage.test.ts, src/app/api/introspect/route.test.ts, src/app/api/generate/route.inspect.test.ts; UI: tests/regression/testforge.page-types.spec.ts)
Expected result: One URL behaves as today. One page URL per line runs exactly those pages: the first URL’s origin is the run’s site, each page keeps its path, query and hash route (/#/contact), duplicates and blank lines are dropped, selection by page type is skipped, and the report says “pages chosen by the user” (with a crawl of that site it also names the types the list covered and left out; without one each page stands alone). The list stays in the field after generating. A page on another origin, or a non-http(s) URL, is rejected before the run, naming it: in the field (Generate disabled), and at /api/introspect and /api/generate (400) for callers that send full URLs; a same-origin full URL is inspected as its path. Follow-up (2026-10-07): every page is resolved against the base URL as the inspector opens it, so a path that resolves to another site (//evil.test/x, /\evil.test/x, \\evil.test\x) is rejected the same way, naming it (400 at both routes), and never visited. URL check (TFP-173’s review): /api/run keeps only http:/https: URLs on the run’s origin in the page-type record (type URLs, covered pages, the override’s lists); the rest are dropped, so the HTML export never contains a javascript: or another site’s URL. Proven 2026-10-07: parser cases; the round trip for Standard and Comprehensive (the covered list parses back to the same pages, the suite’s pages are the same, the list run’s report lists them again); hostile URLs dropped and absent from the export; through the UI, the /types report’s covered list pasted back inspects the same 8 pages and the generated suite’s page data is the same; a list with another origin names it and disables Generate.
measurement, benchmarkStop at Gate B after this ticket.
fac43b6, 7233751 (TFP-174’s follow-ups) and 20d6773
(TFP-175), verified 2026-10-07 (Cowork). Outcome: the selection is kept.
8c05578, verified in Cowork).Passed 2026-10-07 on 8c05578: both Toolshops give exactly their 9
expected types; the-internet gives 57, with its form types listed.
Passed 2026-10-07 (Emil): the automatic selection meets Decision 9’s keep rule and is kept. Phase 40 is complete.