diff --git a/config/search/README.md b/config/search/README.md index e3a1fe33..34ad63d7 100644 --- a/config/search/README.md +++ b/config/search/README.md @@ -20,7 +20,9 @@ this directory. the existing indices through Algolia's settings UI or `setSettings` API. Preserve settings not listed in the deltas. Put the same values in the Crawler's `initialIndexSettings` for future new indices: those initial settings - do **not** update an existing index. + do **not** update an existing index. When introducing a grouping field such + as `section_url`, finish the crawl in step 7 and verify the field is present + before enabling that field on the existing index. 6. Copy [agent-instructions.md](agent-instructions.md) into this application's Agent Studio agent prompt and [system-instructions.md](system-instructions.md) into its System prompt editor. Apply the system prompt for testing, test both @@ -55,6 +57,17 @@ this directory. - Both indices omit blog listings, tag archives, and the site's search page. Individual articles and API documentation remain included and receive their own category labels. No client-side result filtering hides these sources. +- Keyword records carry `section_url`, the nearest containing level-two heading + with the record's edition and other query parameters preserved. Native Algolia + distinct grouping returns the best matching subsection within each section; + its actual result URL still points to that subsection. All source records stay + searchable. API entries and unknown anchors keep their individual URLs so + independent interfaces are not collapsed into an article section. +- Every API chunk in the AI index identifies itself as developer reference + material. Command names and preference keys alone do not establish visible + controls. An end-user guide must supply the access path; configuration advice + also needs the exact file, key, value, and scope. Keep this distinction in both + extraction and instructions rather than adding feature-specific prompt recipes. - The rehype plugin adds `data-search-params` to headings inside query-enabled Docusaurus tabs. Extraction combines that metadata with the exact section anchor, for example `?edition=community#copy-your-picture`. Docusaurus itself @@ -129,6 +142,8 @@ source guides so future documentation changes do not require prompt recipes. | `find and replace` | The current-file walkthrough, opening Replace, entering both values, reviewing/replacing matches, and saving. Distinguish project-wide replacement without forcing both procedures into one answer. | | `What does alt mean?` | A short explanation of the image description, with a small example if useful. Do not repeat the full image tutorial. | | `Show the Image Gallery screenshot from the tutorial` | A relevant source screenshot that loads, meaningful alternative text, a separate full-size link, and the source guide. Check that it fits the desktop and mobile answer panel. | +| `I cannot find Auto Update in Help` | Never infer a menu from `HELP_AUTO_UPDATE`. Once the updated Managing App Updates guide is deployed and crawled, explain the desktop `autoUpdate` preference in `phcode.json`, valid JSON, saving, and its limits. Until that evidence is retrieved, state the documentation gap without guessing a setting or substituting an update-server setup. | +| A request for an undocumented scheduled sync control | Search the docs, distinguish missing evidence from an impossible feature, and avoid invented menus, intervals, or configuration keys. Ask for the visible label if needed; do not turn related Git or publishing features into the requested control. | Retain modes, dialogs, locations, and saving when shortening prose. A documentation link can provide screenshots and optional practice files; it should not replace @@ -427,8 +442,8 @@ Prompt changes alone cannot restore an icon absent from the retrieved source. Its agent ID is unchanged, so this model switch does not require a site build. The separate production key has no expiry; billing uses the manually funded prepaid balance. Automatic top-ups remain off. No secret is stored in this - repository. The former Azure `gpt-6-luna` provider remains available for rollback - through Agent Studio; save and reload after any provider change. + repository. The former Azure `gpt-6-luna` provider was subsequently removed in + the production-only cleanup recorded below; it is no longer a rollback option. - Live browser checks confirmed the new model/key were used, source screenshots loaded, HTML was highlighted, and tested source links returned HTTP 200. A model switch does not repair missing or misleading source evidence. The earlier @@ -460,12 +475,82 @@ Prompt changes alone cannot restore an icon absent from the retrieved source. lockfile, and the maintained `5.2.0-phcode.2` build agree; no package upgrade was needed. +### Production cleanup and grounding follow-up on 18 November 2026 + +- Removed the seven unused draft/benchmark agents and the unused OpenRouter test + and Azure providers from Algolia. Only the published documentation agent and + `Phoenix Docs Sonnet Production` provider remain. The two production indices + and crawler are retained; no public MCP server was configured. This cleanup + did not revoke keys or change billing in external provider accounts. Do not + recreate test endpoints during routine QA: use the retained agent's unsaved + preview, then save only the reviewed instructions. +- The earlier control-icon website release is deployed. Its extraction and + prompt guidance were applied, crawled, and checked in fresh live answers. + The earlier pending-deployment and draft-prompt statements above describe + their respective checkpoints, not the current production state. +- Checked the current Phoenix `prod` source at + `1cd3f2f3d59dc19f44c3d70d038728a6e5ba9959`. Both desktop updater implementations + register `HELP_AUTO_UPDATE` but do not add it to Help. They read the `autoUpdate` + preference; a pending update and some checks can precede that preference gate. + Added the precise desktop preference workflow and limitations to + [Managing App Updates](../../docs/09-Schools%20%26%20Workplaces/03-managed-updates.md). + This guide change is local and still needs website deployment and a recrawl. + Do not claim that the live assistant can already retrieve its new instructions. +- Published and read back the new extraction actions and `initialIndexSettings`. + The completed crawl had 252 successful URLs, 43 ignored URLs, and no failures; + it retained 5,449 keyword records and 203 AI records. All 116 API records carry + the source-context label, and no AI record contains embedded image data. + A 1,000-record keyword sample had no missing `section_url`; sampled API entries + retained their exact URL as the grouping key. The managed configuration, + schedule, scope, and 30% record-loss safeguard were preserved. +- After the refreshed records were live, changed only the existing keyword + index's distinct attribute from `url` to `section_url`. Its one-way + `find and replace → replace text` synonym remains. All 15 cases in + [evaluation.json](evaluation.json) passed. Styles Bar's Text Color section + moved from fourth to second for `text color` and `text colour`; font size and + Python terminal remained first. The actual full search page also showed the + corrected ordering. A tested proximity-first ranking candidate harmed font + results and was rejected; no query-specific boost or client-side filtering + was introduced. +- Saved and reloaded both reviewed prompts, confirming exact matches with this + directory. The production provider/model and tools were retained. Preview + checks covered image insertion, an `alt` follow-up, Community replacement, + an undocumented scheduled-sync control, the missing auto-update switch, and + a change of topic to project-wide replacement. The image workflow kept both + editions, required controls, loaded icons, and two screenshots; replacement + kept Highlight Mode and editing the existing tag. The follow-up did not repeat + the tutorial. Unsupported-control samples did not invent a menu or config key. + Earlier candidates reproduced an unrelated administrator procedure; the final + instructions instead link adjacent material without substituting its steps. +- These are sampled improvements, not a guarantee of concise or error-free + answers. Some responses still include extra explanation and repeated searches. + The current auto-update response acknowledges the missing end-user procedure; + retest it after deploying and crawling the new guide. Record visible answer + outcomes without saving raw diagnostic request/response traffic that may + include private configuration. +- A fresh answer on the deployed search page retained the Pro and Community + insertion workflows, two loaded screenshots, six source-backed control icons + (including the lightning bolt), highlighted HTML, and encoded source links. + At 390 px, the screenshots fitted the panel, icons remained 20 px, and neither + the page nor panel overflowed horizontally. The answer still labeled the Pro + description step optional; keep checking source completeness rather than + treating visual rendering or answer length as a complete quality score. +- The live npm registry and official release notes were checked again: + DocSearch `5.2.0` and Docusaurus `3.10.2` are still the latest stable versions. + Manifest, lockfile, and maintained `5.2.0-phcode.2` upstream provenance agree; + no dependency upgrade was needed. All 38 search tests and 14 tutorial/link + tests passed, along with packaging, the production build, and generated + search, tutorial, and local-link checks. Existing unrelated anchor/blog + warnings remain. The new preference instructions were reviewed at desktop + and 390 px widths with no horizontal overflow. + ## Official references - [Docusaurus query-string tabs](https://docusaurus.io/docs/markdown-features/tabs#query-string) - [Algolia extraction actions](https://www.algolia.com/doc/tools/crawler/apis/configuration/actions/) - [Algolia initial index settings](https://www.algolia.com/doc/tools/crawler/apis/configuration/initial-index-settings/) - [Algolia attribute ranking strategies](https://www.algolia.com/doc/api-reference/api-parameters/attributeCriteriaComputedBy) +- [Algolia distinct grouping attribute](https://www.algolia.com/doc/api-reference/api-parameters/attributeForDistinct) - [Algolia response caching and cost controls](https://www.algolia.com/blog/product/guardrails-agent-studio) - [Google robots metadata](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag) - [Docusaurus postBuild lifecycle](https://docusaurus.io/docs/api/plugin-methods/lifecycle-apis#postbuildprops) diff --git a/config/search/agent-instructions.md b/config/search/agent-instructions.md index d59d0844..95d2a867 100644 --- a/config/search/agent-instructions.md +++ b/config/search/agent-instructions.md @@ -12,13 +12,16 @@ You help people use Phoenix Code, the code editor for developers, designers, and - Start with a focused query for the user's goal and `number_of_results: 3`. Do not introduce unestablished context or send a long list of loosely related keywords. Search again when results only partly match or more evidence is needed to answer all parts. - Prefer guides and feature documentation that explain the actual task. A listing, release summary, FAQ, or overview pointing elsewhere is not the complete procedure. Read the referenced detailed sections, including prerequisites and controls, before answering. - Retrieve the documented editor workflow before falling back to generic code for a task in Phoenix Code. Verify its edition, platform, mode, selected element or file type, and limitations. Do not transfer a control from a related feature without evidence. +- Separate developer interfaces from user controls. An API command, preference key, or translated label does not establish a visible menu item or switch. UI instructions need a documented access path; configuration edits need the exact supported key, value, file, and scope. Do not turn an API identifier into a guessed menu path or advise changing an unidentified setting. - Treat edition metadata and Pro Feature notices as authoritative. An absent edition label does not mean free; a Pro-only source does not establish a Community method. Retrieve a documented alternative when needed. - General programming and web-development questions are welcome. Answer them directly from reliable knowledge, with a usable example or authoritative reference when useful. Distinguish that knowledge from documented product behavior. Explain the scope briefly for unrelated requests, without a canned refusal. -- If focused searches cannot establish a product detail, identify the gap and offer a supported next step. Do not guess controls, shortcuts, or links. +- If focused searches cannot establish a product detail, state the specific gap briefly and give one useful next step. Do not list unrelated platform behavior, speculative reasons, or every unsuccessful source. Do not substitute a complex adjacent workflow that does not achieve the requested result; a related guide can be linked without reproducing its procedure. Do not guess controls, shortcuts, or links. +- Stop searching when further results only repeat the same internal symbols or unrelated guides. Explain the specific evidence gap instead of expanding into tangential searches or speculating about hidden settings. ## Explain what the reader needs - For procedures, apply the System prompt's action-preservation check to every workflow. Adapt the source to the user's goal and current state while retaining each necessary interaction. Preserve panel/dialog access, selection, confirmation, and saving; do not replace these actions with a description of the desired result. Include a result check. +- Organize a walkthrough around meaningful stages, combining adjacent actions when their controls and order stay clear. Use compact numbered steps instead of a separate step for every click. Leave out optional layout changes, repeated checks, and unrelated alternatives unless they solve the user's problem. Keep a necessary assumption brief; do not append another file-type workflow or a general troubleshooting list by default. - Show Phoenix Pro first and Community (free) second when documented workflows differ and no edition was chosen. Apply this to each relevant part of a multi-part request. Honor an explicitly chosen edition; explain shared workflows once. - For troubleshooting, order useful checks using the symptoms and context. Distinguish confirmed facts from possible causes. Ask only for information needed for the next diagnostic decision. - For explanations, comparisons, and narrow follow-ups, answer the point directly without repeating unrelated procedures. Use examples or tables when useful. Keep similar operations distinct according to the actual goal. diff --git a/config/search/evaluation.json b/config/search/evaluation.json index e281de0a..8b1a2e45 100644 --- a/config/search/evaluation.json +++ b/config/search/evaluation.json @@ -1,5 +1,8 @@ [ {"query":"text color","expectedPath":"/docs/Pro%20Features/styles-bar#text-color","maxRank":3}, + {"query":"text colour","expectedPath":"/docs/Pro%20Features/styles-bar#text-color","maxRank":3}, + {"query":"change font size","expectedPath":"/docs/tutorials/edit-text-fonts?edition=pro#pro-change-font","maxRank":3}, + {"query":"python terminal","expectedPath":"/docs/tutorials/run-python#3-open-the-terminal","maxRank":3}, {"query":"how to change input text colors","expectedPath":"/docs/editing-colors#change-input-text-colors","maxRank":5}, {"query":"find in files","expectedPath":"/docs/Features/find-in-files","maxRank":1}, {"query":"find and replace","expectedPath":"/docs/tutorials/find-and-replace","maxRank":3}, diff --git a/config/search/records.cjs b/config/search/records.cjs index ab689c77..2392b87a 100644 --- a/config/search/records.cjs +++ b/config/search/records.cjs @@ -16,12 +16,22 @@ function extractSearchRecords({$, url, helpers}, format, resolveTabUrl) { path.startsWith('/videos/') ? 'Videos' : 'Documentation'; const language = $('meta[name="docsearch:language"]').attr('content') || 'en'; const parametersByAnchor = Object.create(null); + const sectionsByAnchor = Object.create(null); const editionSections = []; const explicitEditions = ($('meta[name="docsearch:edition"]').attr('content') || '') .split(',').map(value => value.trim()).filter(value => ['pro', 'community'].includes(value)); let introductoryProNotice = false; let reachedSection = false; const contentRoot = $('main article').length ? $('main article').first() : $('main').first(); + let sectionAnchor = ''; + contentRoot.find('h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]').each((_, element) => { + const heading = $(element); + const tag = element.tagName || element.name; + const anchor = heading.attr('id'); + if (tag === 'h1') sectionAnchor = ''; + if (tag === 'h2') sectionAnchor = anchor; + sectionsByAnchor[anchor] = sectionAnchor || anchor; + }); contentRoot.find('h2, h3, h4, h5, h6, .theme-admonition').each((_, element) => { const node = $(element); // A Pro note inside a tab or a later section qualifies that section only. @@ -93,6 +103,13 @@ function extractSearchRecords({$, url, helpers}, format, resolveTabUrl) { const recordUrl = resolveTabUrl(record.url, parametersByAnchor); const target = new URL(recordUrl, pageUrl); const selectedEdition = target.searchParams.get('edition'); + let anchor = target.hash.slice(1); + try { anchor = decodeURIComponent(anchor); } catch (error) { /* Keep malformed anchors distinct. */ } + const section = new URL(target); + // Keep the best matching nested heading for each article section. All + // records remain searchable, and different edition queries stay separate. + // API entries are independent interfaces, even under a shared heading. + if (category !== 'API' && sectionsByAnchor[anchor]) section.hash = sectionsByAnchor[anchor]; target.hash = ''; return { ...record, @@ -103,6 +120,7 @@ function extractSearchRecords({$, url, helpers}, format, resolveTabUrl) { } : {}), url: recordUrl, url_without_anchor: target.href, + section_url: section.href, }; }); } @@ -207,6 +225,8 @@ function extractSearchRecords({$, url, helpers}, format, resolveTabUrl) { const availability = edition === 'pro' ? 'Edition availability: Phoenix Pro only.\n\n' : edition === 'community' ? 'Edition availability: Community (free).\n\n' : edition === 'mixed' ? 'Edition availability: this page has separate Phoenix Pro and Community (free) sections.\n\n' : ''; + const sourceContext = category === 'API' ? + 'Source context: developer API reference. Command identifiers, functions, and preference keys describe code interfaces. Their presence does not establish a visible menu item, shortcut, or settings control. User-interface availability and access paths need separate end-user documentation.\n\n' : ''; const records = helpers.splitTextIntoRecords({ text, baseRecord: { @@ -220,11 +240,11 @@ function extractSearchRecords({$, url, helpers}, format, resolveTabUrl) { docusaurus_tag: tags.split(',').map(value => value.trim()).filter(Boolean), editionSections, }, - // Reserve room for the repeated edition label in every returned chunk. + // Reserve room for source context and the edition label in every chunk. maxRecordBytes: 99000, orderingAttributeName: 'part', }); - return records.map(record => ({...record, text: availability + record.text})); + return records.map(record => ({...record, text: sourceContext + availability + record.text})); } function extractDocSearchRecords(context) { diff --git a/config/search/settings.cjs b/config/search/settings.cjs index 1359b4d8..8b580313 100644 --- a/config/search/settings.cjs +++ b/config/search/settings.cjs @@ -14,6 +14,10 @@ const indexSettings = { removeStopWords: ['en'], minProximity: 2, attributeCriteriaComputedBy: 'sum', + // Nested article headings should not crowd out other matching sections. + // section_url retains edition parameters; API entries keep their own URL. + attributeForDistinct: 'section_url', + distinct: true, }, 'markdown-index': { attributesForFaceting: [ diff --git a/config/search/system-instructions.md b/config/search/system-instructions.md index 0c573144..99f596e7 100644 --- a/config/search/system-instructions.md +++ b/config/search/system-instructions.md @@ -6,13 +6,15 @@ Understand the current goal from the user's words and relevant conversation cont Retrieve evidence before making product-specific claims. The first search result does not establish the user's file type, platform, edition, or goal. Verify feature availability and control names against the relevant source. Never invent an action, control, shortcut, screenshot, URL, or claim to have changed the user's files. If evidence is missing, search further or explain the specific gap. +Distinguish implementation evidence from an end-user procedure. A registered command, exported symbol, preference key, or translated label is not proof of a reachable menu item or setting. Do not infer a menu from a command's name or namespace. Configuration instructions require a verified file, key, value, and scope; never suggest changing an unknown setting just because its name sounds relevant. If the available sources cannot establish a procedure, say what is unverified without speculating about hidden controls. Missing documentation alone does not prove a feature is impossible. + ## Preserve actions in procedures A procedural answer must let the reader perform the task, not merely describe its outcome. Before writing one: 1. Identify the applicable source procedure for each recommended workflow. Resolve references to earlier steps or another section by reading and incorporating the necessary actions. Keep the user's current state and requested result in view. 2. Retain the full sequence of required interactions: setup, selecting the object, enabling the mode, opening each panel or dialog, finding the control, entering the value, confirming it, saving, and checking the result. Include only interactions the task requires, but omit one only when the conversation establishes it is already complete or the source explicitly makes it optional. -3. Write numbered instructions that preserve that sequence. Name the control and where to find it when the source provides that information. Explain how to reach a setting before saying what to change. Give separate steps to transitions between controls or dialogs; adjacent actions can share a step only when their order and controls remain explicit. Shorten background explanation, not required actions. +3. Write compact numbered stages that preserve that sequence. Name the control and where to find it when the source provides that information. Explain how to reach a setting before saying what to change. Combine adjacent actions into the same step when their order and controls remain explicit; a new click or dialog does not automatically need a new numbered step. Shorten background explanation and repetition, not required actions. 4. Check the instructions against the source before sending: can a reader reach each next control using the preceding steps? Does every requested setting have an access path, value, and confirmation where required? Does the user know how to save and verify the change? Repair omissions from the source. A screenshot or guide link does not substitute for these instructions. An automatically updating preview is not proof that a file is saved. Preserve saving unless the source explicitly confirms automatic saving. A narrow follow-up needs only its remaining actions; explanations and comparisons do not need a procedure. Do not disclose the preparation or checking process. @@ -21,6 +23,8 @@ An automatically updating preview is not proof that a file is saved. Preserve sa Answer every part of the current request in the form it needs. Use ordered steps for procedures, evidence-based checks for troubleshooting, and direct explanations for conceptual questions. A short request still needs a usable answer. Do not force a fixed length, introduction, summary, or closing question. +Stay within the requested task. Omit optional workspace rearrangements, speculative alternatives, and unrelated follow-up tutorials. Put a necessary assumption in a brief phrase. Use one result check per workflow instead of repeating it in an introduction, a step, and a conclusion. A narrow question about one control or one concept needs a direct answer, not the full setup procedure. When evidence is insufficient, briefly name the gap and one useful next step; do not turn the uncertainty into a catalogue of sources, platform differences, or possible hidden controls. + Honor a specified edition and platform. When documented workflows differ and no edition is selected, show Phoenix Pro first and Community second, within each relevant task. Preserve the visual/code choice even when code also works in Pro. Explain shared steps once. Include a relevant retrieved screenshot for a visual workflow when available, unless the user requests text only. Match it to the edition and actions it illustrates. Use a standalone Markdown image and a separate full-size link with exact retrieved URLs. Never invent an image URL. Keep complete text instructions alongside it. diff --git a/docs/09-Schools & Workplaces/03-managed-updates.md b/docs/09-Schools & Workplaces/03-managed-updates.md index 59849cb0..b625ef06 100644 --- a/docs/09-Schools & Workplaces/03-managed-updates.md +++ b/docs/09-Schools & Workplaces/03-managed-updates.md @@ -1,11 +1,12 @@ --- title: Managing App Updates slug: "/managed-updates" +description: Control automatic updates in the Phoenix Code desktop app or configure an update server for managed devices. --- # Managing App Updates -🔄 Point the Phoenix Code desktop app at your own update server. +Control updates on your computer or on devices you manage. ## Overview @@ -13,6 +14,41 @@ By default, the Phoenix Code desktop app checks the official Phoenix Code update This applies to the desktop app only. +## Turn off automatic updates on your computer + +There is no **Help → Auto Update** menu switch in Phoenix Code. The desktop app +has an advanced `autoUpdate` preference, which you edit in the preferences file. +The `HELP_AUTO_UPDATE` name in the developer API reference is an internal command; +it is not a menu location. + +1. In the desktop app, choose **File → Open Preferences File**. +2. Edit **phcode.json** on the right. The **defaultPreferences.json** file on the + left is read-only. Add `"autoUpdate": false` inside the existing outer braces, + keeping your other settings and separating properties with commas. If the + property already exists, change its value instead of adding a duplicate. + + For an otherwise empty preferences file: + + ```json + { + "autoUpdate": false + } + ``` + +3. Save **phcode.json**. Reopen **File → Open Preferences File** and check that + `autoUpdate` is still `false` in your saved settings. + +The app can still check for new versions and show an update notification. This +preference stops the automatic update flow; it does not cancel an update already +downloaded or waiting for a restart. You can still choose **Help → Check for +Updates** to update manually. To restore automatic updates, change the value to +`true` and save. + +For screenshots of the preferences editor, see +[Editing Preferences](/docs/editing-text#editing-preferences). +To control which versions a school or workplace receives, use the administrator +configuration below. + ## Config File Create the folder as an administrator, then place a file named `phoenix_override_config.json` in it: diff --git a/scripts/search-crawler.test.cjs b/scripts/search-crawler.test.cjs index feeffa07..844dd3c2 100644 --- a/scripts/search-crawler.test.cjs +++ b/scripts/search-crawler.test.cjs @@ -52,6 +52,42 @@ test('section links select the edition without losing encoded paths, unrelated q assert.deepEqual(record.weight, {level: 3}); }); +test('nested article results group by their containing section without merging editions or independent API entries', () => { + const html = '

Guide

Colors

Input

Button

Fonts

Size

'; + const url = 'https://docs.phcode.dev/docs/A%20Guide'; + const docRecords = ['colors', 'input', 'button', 'size', 'unknown'].map(anchor => ({url: `${url}#${anchor}`})); + const context = fixture(url, html, docRecords); + const original = context.$.html(); + const records = extractDocSearchRecords(context); + assert.equal(records[0].section_url, `${url}#colors`); + assert.equal(records[1].section_url, `${url}#colors`); + assert.equal(records[1].url, `${url}#input`); // Keep the best result's precise destination. + assert.equal(records[2].section_url, `${url}?edition=community#colors`); + assert.equal(records[3].section_url, `${url}#fonts`); + assert.equal(records[4].section_url, `${url}#unknown`); // Do not guess missing headings. + assert.equal(records.length, docRecords.length); // Group at query time; discard no content. + assert.equal(context.$.html(), original); + const apiUrl = 'https://docs.phcode.dev/api/API-Reference/example'; + const api = extractDocSearchRecords(fixture(apiUrl, html, ['colors', 'input'].map(anchor => ({url: `${apiUrl}#${anchor}`})))); + assert.notEqual(api[0].section_url, api[1].section_url); +}); + +test('API evidence context survives every AI chunk without changing ordinary guide text', () => { + const api = fixture('https://docs.phcode.dev/api/API-Reference/command/Commands', '

Commands

HELP_AUTO_UPDATE toggles auto update.

'); + api.helpers.splitTextIntoRecords = ({baseRecord}) => [ + {...baseRecord, text: 'HELP_AUTO_UPDATE toggles auto update.'}, + {...baseRecord, text: 'A second command.'}, + ]; + const original = api.$.html(); + for (const record of extractMarkdownRecords(api)) { + assert.match(record.text, /^Source context: developer API reference\./); + assert.match(record.text, /does not establish a visible menu item/); + } + assert.equal(api.$.html(), original); + const guide = fixture('https://docs.phcode.dev/docs/guide', '

Guide

Open the menu.

'); + assert.doesNotMatch(extractMarkdownRecords(guide)[0].text, /Source context: developer API/); +}); + test('OS and sharing tabs use their own query keys; API and blog classification stays distinct', () => { for (const [path, parameters, category] of [ ['/docs/tutorials/run-python', 'system=macos', 'Documentation'],