# Extend PeopleSoft project XML generation for the Integration Broker Service Operation family Extend the brownfield Python project at `f:\storage-dev\peoplesoft-developer` to support these six currently unsupported Application Designer instance classes: 1. `SRVM` — Service 2. `SCMA` — Schema 3. `OPRHM` — Operation Handler 4. `OPRVM` — Operation Version 5. `OPRM` — Operation 6. `RTDM` — Routing The purpose is to package a PeopleSoft-native OIDC/SSO integration as an importable Application Designer project, eliminating manual Integration Broker reconfiguration after database refreshes. ## Required plan shape Produce exactly six mutating implementation tasks, one per object type, in this order: 1. `add-srvm-service-support` — no dependencies 2. `add-scma-schema-support` — depends on `add-srvm-service-support` 3. `add-oprhm-handler-support` — depends on `add-scma-schema-support` 4. `add-oprvm-version-support` — depends on `add-oprhm-handler-support` 5. `add-oprm-operation-support` — depends on all preceding four tasks 6. `add-rtdm-routing-support` — depends on `add-oprm-operation-support`, `add-srvm-service-support`, and `add-oprvm-version-support` Do not create separate discovery, setup, documentation, or final-regression task nodes. The first task must include initial pattern study and a baseline full test run. This is an initialized brownfield repository; do not create an infrastructure task. ## Existing patterns to study Inspect the existing implementations before editing: - `tools/project_xml/models/_complex_defs.py` - `tools/project_xml/models/_object_defs.py` - `tools/project_xml/emitters/_complex_defs.py` - `tools/project_xml/emitters/_object_defs.py` - `tools/project_xml/emitters/_peoplecode.py` - `tools/project_xml/emitters/_app_engine.py` - `tools/project_xml/models/__init__.py` - `tools/project_xml/emitters/__init__.py` - `tools/project_xml/__init__.py` - `tools/project_xml/xml_emitter.py` - `tools/project_xml/emitters/_utils.py` - `tools/project_xml/_deserializer.py` - `tools/project_xml/_tool_schema.py` - `tests/test_new_instance_types_2.py` - `tests/test_new_instance_types_3.py` - `tests/test_corpus_conformance.py` Use `scratch/research_ib_family.py` and `scratch/corpus_schema.json` as authoritative research. Do not redo the research or rebuild the corpus. A real export containing these structures is `f:\storage-dev\peoplesoft-projects\CASHNET_PS_LOOKUP\CASHNET_PS_LOOKUP.XML`. ## Requirements for every object-type task Each task must deliver: - A public `ProjectItem` dataclass model with `get_object_type()`, `get_object_ids()`, `get_object_values()`, `get_description()`, `is_definition()`, and required-field validation in `__post_init__()`. - Child dataclasses for meaningful nested rowsets. - An XML emitter with exact corpus field order, POINTER/HANDLE conventions, XML escaping, counts, and rowset byte-size constants. - Constants in the canonical emitter utility module and compatibility re-exports where appropriate. - Model, emitter, package, XML-dispatch, output-order, MCP deserializer, and MCP tool-schema wiring. - Unit tests covering validation, defaults, metadata, PjmPit entries, XML structure, empty/populated children, escaping, counts, and sizes. - A dedicated corpus-conformance class in `tests/test_corpus_conformance.py` with field-order and rowset-size assertions using the existing helpers. Also assert that all expected root fields are emitted; do not rely only on the helper's common-field filtering. - Full `pytest tests/` success before completion. Never delete, weaken, skip, or xfail existing tests. The collected test count must not decrease; all 985+ existing tests must remain green. ## Task 1: SRVM Service Implement `ServiceDefinition`. PjmPit: `eObjectType=79`, IDs `(138, 0, 0, 0)`, values `(service_name, "", "", "")`. Corpus: 112 instances; root `Service`; root size 2000; nested `Serviceopr` and `char`. Root field order: `szLastUpdDttm`, `szLastUpdOprId`, `szObjectOwnerId`, `nUseCount`, `bUseUpdate`, `lVersion`, `lSwapVersion`, `nSwapNum`, `szIb_servicename`, `szIb_namespace`, `szIb_aliasname`, `cPsftservice_flag`, `nRestService`, `nOpenAPI`, `szPtibapplname`, `szIbExternalUserId`, `szIbExternalPwd`, `szTokenType`, `szPtibappsrvgrp`, `szDescr`, `lpszDescrlong`, `nDescrlongLen`, `lpServiceuddi`, `nServiceuddiCnt`, `lpServiceopr`, `nServiceoprCnt`, `lpServicelang`, `nServicelangCnt`, `szLanguageCd`. Support zero, one, and multiple `Serviceopr` references and the existing UTF-16LE `char` rowset convention for non-empty long descriptions. ## Task 2: SCMA Schema Implement `SchemaDefinition`. PjmPit: `eObjectType=90`, IDs `(153, 154, 0, 0)`, values `(message_name, message_version, "", "")`. Corpus: 338 instances; root `Ibscmadfn`; root size 1040; nested `pDataChunk`. Root field order: `szLastUpdDttm`, `szLastUpdOprId`, `szObjectOwnerId`, `nUseCount`, `bUseUpdate`, `lVersion`, `lSwapVersion`, `nSwapNum`, `szMsgname`, `szApmsgver`, `szPublisher`, `szIb_namespace`, `nSchemaType`, `pScmaChunk`, `nNumberOfChunks`. ### Mandatory SCMA blob subtask `pScmaChunk`/`nNumberOfChunks` contains the actual schema document as a chunked binary payload. This is not an ordinary string. Study the existing `peoplecode_blob`, `lpProgSource`, and other chunk/blob patterns in `emitters/_peoplecode.py` and `emitters/_app_engine.py`. Follow the corpus-compatible POINTER → chunk rowset → `char` payload representation, encoding, sequence, size, and count semantics. Do not put raw schema text directly in the root row and do not invent a new serialization mechanism. Test empty and non-empty documents, single and forced multi-chunk payloads, chunk count, sequence ordering, per-chunk sizes, lossless payload round-trip, and XML escaping safety. ## Task 3: OPRHM Operation Handler Implement `OperationHandlerDefinition` and an application-class binding child model sufficient for an `IRequestHandler`. PjmPit: `eObjectType=81`, IDs `(139, 140, 0, 0)`, values `(operation_name, handler_name, "", "")`. Corpus: 169 instances; root `Oprhdlr`; root size 952; nested `Operationac` and `char`. Root field order: `szLastUpdDttm`, `szLastUpdOprId`, `szObjectOwnerId`, `nUseCount`, `bUseUpdate`, `lVersion`, `lSwapVersion`, `nSwapNum`, `szOperationname`, `szHandlername`, `szHandleraliasname`, `szHandlerid`, `szHandlerowner`, `szHandlertype`, `cActive_flag`, `nSeqnumber`, `cRollback_flag`, `szAttributeName`, `szAttributeValue`, `nDMSRollBack`, `nDMSMode`, `cSubProc_flag`, `szDescr`, `lpszDescrlong`, `nDescrlongLen`, `lpOperationac`, `nOperationacCnt`, `lpOperationci`, `nOperationciCnt`, `lpOperationdms`, `nOperationdmsCnt`, `lpOperationae`, `nOperationaeCnt`, `lpOprhdlrlang`, `nOprhdlrlangCnt`, `szLanguageCd`. Populate `Operationac` with package root, qualifying path, class, and method. Preserve zero-count POINTER output for CI, DMS, AE, and language children. Emit standalone top-level `OPRHM`; Task 5 will connect it to `OPRM`. ## Task 4: OPRVM Operation Version Implement `OperationVersionDefinition` with child models for operation-version parameters and generated-routing references. PjmPit: `eObjectType=82`, IDs `(139, 141, 0, 0)`, values `(operation_name, version_name, "", "")`. Corpus: 328 instances; root `Oprverdfn`; root size 696; nested `Oprverdfnparm`, `Oprvgenrtgparm`, `char`, and rare `Oprvdeploy`. Root field order: `szLastUpdDttm`, `szLastUpdOprId`, `szObjectOwnerId`, `nUseCount`, `bUseUpdate`, `lVersion`, `lSwapVersion`, `nSwapNum`, `szOperationname`, `szVersionname`, `cActive_flag`, `cNr_flag`, `cValidation`, `nValidationLevel`, `cSyncnonblock`, `cExport_flag`, `cMulti_queue`, `cExcludeToken`, `cClientimplement`, `szIbdoclayoutname`, `szDescr`, `lpszDescrlong`, `nDescrlongLen`, `lpOprverdfnparm`, `nOprverdfnparmCnt`, `lpOprverqueparm`, `nOprverqueparmCnt`, `lpOprverdfnlang`, `nOprverdfnlangCnt`, `lpOprvgenrtgparm`, `nOprvgenrtgparmCnt`, `lpOprvdeploy`, `nOprvdeployCnt`, `szLanguageCd`. Support request, response, and fault parameter rows with message/version, content type, HTTP status, queue, and transform metadata. Support generated-routing references and empty optional pointers. Emit standalone top-level `OPRVM`; Task 5 will connect it to `OPRM`. ## Task 5: OPRM Operation Implement `OperationDefinition` referencing a service and containing URI-template, handler-reference, and version-reference children using the preceding models. PjmPit: `eObjectType=80`, IDs `(139, 0, 0, 0)`, values `(operation_name, "", "", "")`. Corpus: 315 instances; root `Operation`; root size 1704; nested `Operationuritemplate`, `Operationhandler`, `Operationversion`, and `char`. Root field order: `szLastUpdDttm`, `szLastUpdOprId`, `szObjectOwnerId`, `nUseCount`, `bUseUpdate`, `lVersion`, `lSwapVersion`, `nSwapNum`, `szOperationname`, `szDefaultversion`, `cRtngtype`, `cUserpwdreq`, `cRequestStatus`, `nActiveDataGuard`, `nThinkTime`, `nConNav`, `nReadOnlyPermission`, `szRestmethod`, `nRestService`, `szRestBaseurl`, `nRestOverride`, `szServicename`, `szPtibapplname`, `szIb_aliasname`, `szMessagename`, `szMessageversion`, `szDescr`, `lpszDescrlong`, `nDescrlongLen`, `lpOperationlang`, `nOperationlangCnt`, `lpOperationroot`, `nOperationrootCnt`, `lpOperationuritemplate`, `nOperationuritmplCnt`, `lpOperationhandler`, `nOperationhandlerCnt`, `lpOperationversion`, `nOperationversionCnt`, `lpIburitrans`, `nIburitransCnt`, `szLanguageCd`. ### Mandatory OPRM dual-representation subtask Every operation handler and version has both representations in real XML: 1. Compact `Operationhandler` and `Operationversion` child rows nested inside `OPRM`. 2. Full standalone top-level `OPRHM` and `OPRVM` instances for the same objects. Implement both. Use the existing PCM/APM compound-emission architecture and special dispatch paths as the reference. Reuse the Task 3 and Task 4 emitters instead of duplicating full XML logic. Add an integration test proving one operation with one handler and one version emits exactly one `OPRM`, the nested references, one matching `OPRHM`, and one matching `OPRVM`, with consistent names and no accidental duplicate standalone instances. ## Task 6: RTDM Routing Implement `RoutingDefinition` with child models for route subdefinitions, message parameters, connector properties, and routing properties. PjmPit: `eObjectType=83`, IDs `(142, 21, 0, 0)`, values `(routing_name, effective_date, "", "")`. Corpus: 175 instances; root `Ibrtngdefn`; root size 1240; nested `Ibrtngsubdefn`, `Rtngdfnparm`, `Rtngdfnconprp`, `Rtngdfnprop`, and `char`. Root field order: `szLastUpdDttm`, `szLastUpdOprId`, `szObjectOwnerId`, `nUseCount`, `bUseUpdate`, `lVersion`, `lSwapVersion`, `nSwapNum`, `szRoutingdefnname`, `szEffdt`, `cEff_status`, `szSendernodename`, `szReceivernodename`, `szOperationname`, `szOperationversion`, `cRtngtype`, `nDelayProcessing`, `szRestmethod`, `cSyncnonblock`, `cAcceptcompression`, `cInclude_details`, `cOnorderSegments`, `cConnoverride`, `szConngatewayid`, `szConnid`, `nLogmsgdtlflg`, `nDeliveryMode`, `szOnsndhdlrname`, `szOnrcvhdlrname`, `szOnprehdlrname`, `szOnposthdlrname`, `cGenerated`, `cARRSecureEndpoint`, `nLocalIndication`, `szDescr`, `lpszDescrlong`, `nDescrlongLen`, `lpIbrtngsubdefn`, `nIbrtngsubdefnCnt`, `lpRtngdfnconprp`, `nRtngdfnconprpCnt`, `lpRtngdfnparm`, `nRtngdfnparmCnt`, `lpRtngdfnprop`, `nRtngdfnpropCnt`, `lpRtngdfnlang`, `nRtngdfnlangCnt`, `szLanguageCd`. Support sender/receiver nodes, operation/version linkage, REST method, route aliases, request/response parameters, token/security metadata, and optional connector/property pointers and counts. Add a mixed-family integration test generating all six classes in one project and verifying PjmPit entries, top-level instances, dependency ordering, and OPRM dual representation. ## Hard scope boundaries - Pure Python/XML generation only; no live PeopleSoft import. - Do not connect to a live database, Integration Broker gateway, App Designer, or PeopleSoft environment. - Do not modify `tools/project_xml/confidence.py`; these types should receive the existing default `CORPUS_TESTED` behavior after conformance tests exist. - Do not change corpus files or weaken conformance helpers. - Do not refactor unrelated emitters or public APIs. - Do not stop at an empty-pointer-only emitter; nested structures required for real Service Operation packaging must be represented and tested. ## Definition of done for every task `pytest tests/` passes in full, with no test-count reduction and all existing tests green. Also run the repository's configured lint/format checks when available, and run `git diff --check`. No live import or database validation is part of this work.