# Pod discovery: what the scout reads from any Oracle Fusion pod Every Oracle Fusion pod registered in Patchwise is read the same way. Nothing about one particular pod is built in. ## When it runs - **At the start of every run** on a Fusion pod (the scout step). The result is saved on the pod. - **On demand** with **Discover business areas** on the Test environments page (anyone who may start runs), for example right after adding a pod and its sign-in details. Discovery is read-only: GET requests to the pod's REST services through the egress gate, with the pod's test user. ## What it finds **Business areas.** For each area of the catalog (`coworker/platform/fusion_catalog.py`), the record counts of a few standard REST resources give its status: | Status | Meaning | What to do | |---|---|---| | In use | At least one resource has records | Runs can test it | | Set up, no records yet | The services answer but hold no records | Runs can test it if you ask for it | | The test user cannot read it | HTTP 403 | Give the test user the area's roles, then discover again | | Not on this pod | HTTP 404 for every resource | Nothing | | Did not answer | Timeout or server error | Discover again | A refused sign-in (HTTP 401) stops discovery and says so. A run may target the areas found **in use** or **set up**. With no business area chosen, a run tests the areas in use. Before the first discovery, any catalog area may be chosen; the run's scout discovers first and stops with a clear message if none of the chosen areas is on the pod. **Test data.** For each area in use, the most frequent values in its latest records (for Payables: business unit, supplier, supplier site, currency, payment terms, invoice type and the distribution account of recent invoice lines). Test steps use them as `{{pod..}}`, for example `{{pod.ap.supplier}}`. - The values are the client's data. They are stored on the pod, passed only to the test runner (`FUSION_TESTDATA`), added to the redaction list, and never sent to an AI model or written to the audit log (it records only the keys). - An admin can set their own value for any key (**Set test data**); it wins over the discovered one. An empty value goes back to the discovered one. - **Values from the screens' lists.** While the screens are read, the scout opens up to 8 list fields per screen (required ones first) and keeps up to 5 choices each: what THIS test user is offered (a ledger, an accounting period, a journal source, a business unit the user may work in). Each list's label becomes a key ("Journal Source" -> `journal_source`), and so does each catalog key it names ("Procurement BU" is also `business_unit`). They are kept apart from the screen inventories (the AI sees labels only), and the AI may use every key the pod has. - **Several values per key, tried in order.** A step whose value is one pod placeholder tries the pod's values in turn until Fusion accepts one: the admin's own, the one Fusion last accepted, then what this user is offered (the records' values its screens' lists also offer, most used first, then the lists' other choices), and last the other records' values, often other users' business units (`FUSION_TESTDATA_CANDIDATES`, at most 6 per key). Fusion refuses a value by marking the field in error, opening its search window, or an error message (a business unit whose ledger has no open period); the next value is typed over it. The value that worked is used for the rest of the test and remembered for the pod (`FPT_TESTDATA_USED` -> `test_data_learned`), so the next run starts with it. - If no value is accepted, the step fails naming the key, the values tried and where to set one. An empty list for this user (no business unit to choose as a buyer) fails saying the user's access is missing. There are no built-in fallback values. ## The release, and what it changes Oracle Fusion's REST services do not say which quarterly update a pod runs, so the release (for example `26C`) is recorded on the pod: chosen when adding it, or changed on its card. A release typed when starting a run wins. The research step then reads Oracle's **What's New** for that release from docs.oracle.com (`coworker/platform/release_notes.py`), for each business area being tested: - Each area names its guide in the catalog (`readiness`: for example Payables reads Financials, `erp/26c/fins26c`; Purchasing reads Procurement, `scm/26c/proc26c`). - The guide's **Feature Summary** table (Module, Feature, Tags, Impact to Existing Processes, Action to Enable) is read as data, no model involved. A guide shared by several areas is split by its Module column; a feature in a shared module (Local Compliance & Reporting) goes to the area its title names. - Features with **Action to Enable: None** are switched on by the update itself, so they are listed first. The opening text of up to 30 features per area is read from their own pages. - Every change keeps its link to Oracle's page. Guides are cached per release, so each is read once. - A release Oracle has not published (yet) is said plainly on the run, as is a pod without a release: the run goes on without release changes rather than with invented ones. This is public content. It goes through the egress gate, which allows only docs.oracle.com for research. ## Screens The AI test designer writes steps only with labels it has seen on the pod's own screens. **Read screens** on the pod's card (admins, after Discover) collects them: - For each area in use, a real browser signs in once with the test user and opens the area's work areas (the catalog's `navigator`, for example `Payables > Invoices`), lists the tasks in their Tasks panel, and picks up to 4 to read: Create first, then Manage, then Enter/Submit/Review. Imports, spreadsheets, reports and batch processes are skipped. - Each chosen task's screen is recorded: field labels and kinds, buttons, menus, sections and table columns (`automation/scripts/explore-fusion.ts`, `automation/src/fusion/capture.ts`). Never a value, list option, user or address; a file that breaks this rule is deleted. Every page is left with Cancel: nothing is saved on the pod. - It runs in the background (several minutes per area); the card shows the latest step, then per area how many screens were read, which tasks could not be read and which work areas were not found (a name to correct in the catalog). - Screens are kept per pod (`FPT_HOME/screens//`), because pods differ by release and setup. A run's test designer uses that pod's screens for every area it tests; the screens kept with the library are a fallback. They are part of the saved state, so a restart keeps them. - **They are read when the pod is set up, not during a run.** As soon as Discover finds the areas in use (or the pod's release changes), the screens of those areas are read in the background (`FPT_FUSION_SCREENS_ON_SETUP`, default on). A run that starts meanwhile waits for that read instead of repeating it. - **Several browsers read at once** (`FPT_FUSION_WORKERS`, default 3): one sign-in, whose session the others share, and each browser takes the next area. Fusion's own server is the slow part, so a small server handles 3 well. - **An area the user cannot open costs little:** its reading stops after 3 failed tasks in a row or `FPT_FUSION_SCREENS_AREA_MINUTES` (default 20), and an area read on this release is not read again at every run even when it showed nothing: a new release, or Read screens on the card, reads it again. ## From the release's changes to test scenarios On a Fusion pod, the run's coverage view is the release's own changes, not the practice app's coverage maps: - **One row per change** of each area tested, ranked (`research.change_score`): a change the update switches on by itself and that Oracle says affects existing processes first, then other switched-on changes, then opt-in, then those that need setup; scaled by how much the pod uses the area (discovery record counts). - **The AI test designer** gets, per area, the pod's screens, the area's processes and the ranked changes with Oracle's facts (switched on or not, impact, action to enable; never links or pod data). It covers the changes its screens can show first, adds at least one regression scenario of the core process, and names the change each scenario covers. It asks for `FPT_FUSION_AI_SCENARIOS` scenarios per area plus one per switched-on change, at most `FPT_FUSION_AI_SCENARIOS_MAX` (default 8) and two per screen read. - Each scenario is still written as steps checked against the screen and approved by a person before the run. **Nothing runs on the pod before that approval:** the test run is the first time a scenario runs there (so its data is created once), and shows where each one stops. `FPT_FUSION_AI_DRY_RUN=1` dry-runs them on the pod before the approval instead (offering only those that pass; they save on the pod then too). A change covered by a scenario of the run stops being a gap; the rest are listed as not covered yet. - The practice-app proposals ("generated smoke" drafts from coverage maps) are not made on a real pod. - **A full browser run is autonomous:** before designing, it reads the screens of the areas it tests that have none on the pod yet, or were read on another release (usually none: they were read when the pod was set up). A quick simulation never opens the pod. The run says per area how many scenarios were written and offered (or, with the dry run on, how many passed it) and which changes they cover. - **Areas are designed side by side** (`FPT_FUSION_WORKERS` at a time): the model's answers are the slow part. - **Tests run side by side and sign in once.** A test run (or dry run) on a Fusion pod signs the test user in once (`automation/src/fusion/session.ts`); every test starts from that session (the file holds session cookies, never the password, and is deleted when the run ends), and `FPT_FUSION_WORKERS` tests run at once. The Live tab follows the first browser. Tasks of the work area already open are opened from its Tasks list without going home first. ## Test steps for any screen The step runner (`automation/src/fusion/steps.ts`, `ui.ts`) runs the same actions on every Fusion screen; the step writer accepts them only with the screen's own labels, tables, columns and menus: | Action | What it does | |---|---| | `enter` | Types in a field, or chooses in a drop-down list, then leaves it so Fusion runs its defaults | | `add_row`, `enter_in_row` | Adds a row to a section's table and fills the new row's columns | | `menu_action` | Chooses an entry of any of the page's menus | | `click`, `save`, `confirm_if_asked`, `cancel_without_saving` | Buttons, Save, confirmations, leaving without saving | | `expect_filled`, `expect_value`, `expect_status` | Fields Fusion filled, a field's value, the document's status | | `expect_no_error`, `expect_message` | No error message; a message containing given words | | `expect_results` | A search found at least one result | The Payables actions (`add_line`, `invoice_action`) stay for the Payables library scenarios. ## Usage and coverage Discovery says which areas a pod uses; **Read usage** on the pod's card (anyone who may start runs) says *how* the client uses them, so the tests start with the flows the business actually runs (`coworker/platform/usage.py`). **What is read.** For each area with a usage model, the records created in the last 90 days (`q=CreationDate>=...`, `totalResults=true`, at most 2 pages of 500 per resource, child rows of the 10 newest parents, 3 minutes in all), counted by usage dimension. Read-only GETs through the egress gate; the tests' own documents (`FPT-...`) are left out. | Area | Resources | Counted by | |---|---|---| | Payables | invoices, invoiceHolds, payablesPayments | invoice type, source, payment method, approval and validation status; hold name and invoices with holds; payment type, method, status | | Purchasing | purchaseOrders (+ lines), purchaseRequisitions, receivingReceiptRequests | document style, procurement BU, status; line type; requisition status; receipt source | | Receivables | receivablesInvoices, standardReceipts | transaction type and source; receipt method and state | | General Ledger | journalBatches (+ journalHeaders) | journal source, batch status, approval status; journal category | | Expenses, Fixed Assets, Projects, Order Management, Cash Management | expenseReports, fixedAssets, projects, salesOrdersForOrderHub, cashBankStatements | status, asset type, order type, reconciliation status | An area the test user cannot read (HTTP 401, 403, 404) is shown as **not readable**, never as zero usage. A resource that refuses the date filter or the field list (HTTP 400) is read by its newest records instead and says so (`window: latest`). A deployment can give an area its own model with `"usage"` in `FPT_HOME/fusion_areas.json` (the `USAGE` shape). **Coverage.** Each used variant (Payables invoice type Credit memo, 25% of the invoices read) is compared with the scenario library (`tests/cases` and the approved library): a few phrases per variant ("credit memo", "line variance", "pay on receipt") are matched at word starts against the titles, processes and tags of the area's scenarios and its practice family (P2P for Payables and Purchasing, O2C, R2R, A2R). Each match says why ("its title says 'credit memo'"). A variant is **covered** when a scenario that runs on Fusion matches, **practice scenarios only** when only practice-app ones do, else **not covered**. The covered share is weighted by volume (the variant's share times its resource's record count); the gap list is the uncovered variants of at least 1%, most volume first. **In design.** When a pod has a usage profile, the AI scenario designer gets, per area, a short "how this client uses it" section: Oracle's standard values only (invoice types, hold names, journal sources ...) with their share and whether the library covers them. A release change whose text names a variant with 5% or more says so (`client_uses`) and is sent first; the scenarios that come back are ranked by the client's use (uncovered variants count double), a scenario covering such a change is P1, and one on an uncovered variant with a tenth of the volume is at least P2. That is the usage-aware impact analysis. The category values themselves are the client's data: they stay on the pod's record. Values the client defined (business units, its own invoice sources or receipt methods) and dimensions with no standard values are never sent to a model; the section goes through the leak check and the step writer's mask like every design request. The audit log records each area's status and record volume, never a value. ### When Oracle relabels a control (heals) A release can rename a field, button or menu entry. The actions that locate one by its name (`enter`, `enter_in_row`, `click`, `menu_action`, and the buttons and menu entries of the business actions) recover, visibly and only for finding the control. Never for what a scenario checks: `expect_*` steps, statuses, amounts and messages are not healed. 1. **On the spot** (`automation/src/fusion/heal.ts`, `ui.ts`). Only when the normal lookup has failed, so a screen that did not change costs nothing: an approved heal (below); else the same name written differently (case, spaces, punctuation, "(Required)"); else one close name among the names the page shows (similarity of 0.85 or more, clearly ahead of any other, no number that differs, at least four letters). Each heal is a `healed` annotation on the test (`field "Business Unit" -> "Business Units" (close name) at Payables > Invoices > Create Invoice`), listed under "Heals" in the run report. 2. **A proposal.** When no name fits, the test fails as before and records the names the screen showed (`heal-names`). After the attempt the server proposes the closest of them (`coworker/platform/healing.py`, no AI, looser than the automation: 0.6, and never a tie), or records that none is close. 3. **Approval.** A consultant or admin approves or rejects a proposal under "Heals" (the run report, or Self-heal fix review); each decision is audited. Approved heals belong to the test environment (pod) and, as `FPT_HEALS` (a JSON array of `{kind, wanted, to, where?}`), go with every later run on it, including to the remote browser runner (`FPT_HEALS` is on both env allow-lists). `ui.ts` tries them first. | Call | Who | What | |---|---|---| | `GET /api/heals?status=&pod_id=&run_id=` | any user | Proposals (`pending`, `approved`, `rejected`, `no_match`) | | `POST /api/heals/{id}/decision` | consultant, admin | `{"decision": "approve" or "reject", "note"}` | | `GET /api/runs/{id}/heals` | any user | Steps the run healed | ## Adding or changing business areas A deployment can add areas, or change the built-in ones, without a code change: put a JSON list in `FPT_HOME/fusion_areas.json`, each entry in the catalog's shape. An entry whose `code` matches a built-in area replaces the fields it gives; new codes are added. ```json [ {"code": "HCM", "id": "hcm", "name": "Human Capital", "probes": ["workers"], "processes": ["Hire", "Transfer", "Terminate"], "test_data": [{"resource": "workers", "fields": {"legal_employer": "LegalEmployerName"}}]} ] ``` Entries without a code, a name and plain resource names are ignored, with a warning in the log. ## API | Call | Who | What | |---|---|---| | `POST /api/pods/{id}/discover` | may start runs | Discover now; returns the pod with `discovery`, `test_data`, `run_areas` | | `POST /api/pods/{id}/usage` | may start runs | Read the usage profile now (`{"days": 90}`, 7 to 365); returns it | | `GET /api/pods/{id}/usage` | everyone signed in | The saved profile (`read_at` empty when never read) | | `GET /api/pods/{id}/coverage` | everyone signed in | Used variants against the scenario library: `variants`, `gaps`, `covered_share` | | `PUT /api/pods/{id}/test-data` | admin | `{"overrides": {"AP": {"supplier": "..."}}}`; an empty value removes one | | `PATCH /api/pods/{id}` | admin | `{"release": "26C"}` |