Skip to content

[06/36] Add OC-060 schema round-trip validation - #40

Open
cjohnsto-nz wants to merge 6 commits into
feature/oc-040-runtime-scripting-testingfrom
feature/oc-060-schema-roundtrip-validation
Open

[06/36] Add OC-060 schema round-trip validation#40
cjohnsto-nz wants to merge 6 commits into
feature/oc-040-runtime-scripting-testingfrom
feature/oc-060-schema-roundtrip-validation

Conversation

@cjohnsto-nz

@cjohnsto-nz cjohnsto-nz commented Jun 14, 2026

Copy link
Copy Markdown
Owner

@cjohnsto-nz
cjohnsto-nz force-pushed the feature/oc-040-runtime-scripting-testing branch from 6332e33 to 0690860 Compare June 14, 2026 22:45
@cjohnsto-nz
cjohnsto-nz force-pushed the feature/oc-060-schema-roundtrip-validation branch from e631d8a to e5c3f49 Compare June 14, 2026 22:45
@cjohnsto-nz
cjohnsto-nz force-pushed the feature/oc-040-runtime-scripting-testing branch from 0690860 to debe7e0 Compare June 14, 2026 22:49
@cjohnsto-nz
cjohnsto-nz force-pushed the feature/oc-060-schema-roundtrip-validation branch from e5c3f49 to d67e365 Compare June 14, 2026 22:49
@cjohnsto-nz
cjohnsto-nz force-pushed the feature/oc-040-runtime-scripting-testing branch from debe7e0 to 45e5800 Compare June 14, 2026 22:50
@cjohnsto-nz
cjohnsto-nz force-pushed the feature/oc-060-schema-roundtrip-validation branch from d67e365 to da92a88 Compare June 14, 2026 22:50
@cjohnsto-nz cjohnsto-nz changed the title feature/oc-060-schema-roundtrip-validation [06/21] Add OC-060 schema round-trip validation Jun 14, 2026
@cjohnsto-nz cjohnsto-nz changed the title [06/21] Add OC-060 schema round-trip validation [06/27] Add OC-060 schema round-trip validation Jun 15, 2026
@cjohnsto-nz cjohnsto-nz changed the title [06/27] Add OC-060 schema round-trip validation [06/36] Add OC-060 schema round-trip validation Jun 15, 2026
@APKiwi

APKiwi commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Verdict: approve with nits. This is real round-trip fidelity work and the tests are genuinely strong (model round-trip, YAML round-trip, Ajv against the real schema, unknown-field preservation asserted directly). It also quietly fixes two prior fidelity bugs: no-op saves no longer inject a full settings block or an empty runtime object.

  • Minor: the one production logic change ships uncovered. The new rows.length === 0 branch in mergeHeaders/mergeParams (schemaRoundTrip.ts:38-40, 52-54) preserves an empty headers: [] instead of collapsing to undefined, and no fixture has an empty array to exercise it. The change is correct (verified the truthy-assign path and that key-less requests stay key-less), but add the fixture.
  • Minor: the actual panel wiring is untested. collectionPanel.ts:100-105 and folderPanel.ts:91-101 hand-build partial models with length > 0 ? x : undefined conditionals and pass them to applyRequestDefaultsEditorModel. Tests cover the create-from-collection path, not this one.
  • Minor: edits to non-HTTP-editable requests are silently discarded. buildRequestWithSchemaMerge (requestPanel.ts:280-282) returns the clone unchanged for non-HTTP, so visual edits no-op on save with no feedback. Safer than the old force-coerce, but confirm the UI actually gates editing (see the gRPC issue on the OC-100 PR, where it doesn't).
  • Nit: mergeVariables didn't get the same empty-array treatment (schemaRoundTrip.ts:67-68), so variables: [] still collapses while headers: [] survives. Inconsistent fidelity.
  • Nit: the AGENT_PROGRESS ledger entry is process noise in a code PR.

Deps: none added, ajv/yaml already present.

@cjohnsto-nz

Copy link
Copy Markdown
Owner Author

Fixed.

  • Empty-array coverage and variable fidelity: commits d34d834 and a200076 give variables: [] the same preservation semantics as headers: []/params: [], and add focused fixtures for explicit empty HTTP arrays and cleared request-default rows.
  • Collection/folder panel wiring: fixed in d34d834. The panels now pass their header and variable arrays directly to applyRequestDefaultsEditorModel; the length > 0 ? value : undefined branches are removed. Clearing all rows therefore produces explicit empty arrays while preserving sibling defaults such as scripts.
  • Non-HTTP visual edits: already addressed by the owning protocol branches. This PR’s clone-without-mutation guard is intentional OC-060 safety: unsupported visual editors must not damage YAML. PR [09/36] Add OC-010 GraphQL support #43 commit cc721db adds schema-native GraphQL and WebSocket editor models, and PR [19/36] Add OC-110 runtime authoring UX #52 commit 01915d7 adds schema-native gRPC editing. PR [27/36] Add OC-130 protocol first paint stability #59 commit 1dbc25d then verifies protocol-native first-paint/hydration for all four request types. Duplicating those later implementations here would conflict with their owning branches.
  • AGENT_PROGRESS: not changing this. The OC-060 task explicitly required coordination and completion-ledger updates; the file is excluded from the packaged extension and has no runtime impact.

Validation is green: TypeScript compilation, the focused round-trip/validation set (3 files, 11 tests), and the full suite (26 files, 495 tests). PR #40 and immediate child PR #41 are both MERGEABLE/CLEAN, and all PR #40 checks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants