7.4 KiB
7.4 KiB
Task 1 Report
Outcome
Task 1 is implemented on main. The canonical InputValueBinding.value contract
now accepts recursive JSON values, including finite numbers, while preserving
boolean/integer distinction and rejecting non-JSON objects and non-finite
numbers. The two focused browser RPC operations are authored, dispatched,
registered, exported, tested, and included in the explicit browser policy.
The authored RPC fixture now uses the same recursive JSON-value schema as the canonical/generated contract. Runtime and parity tests cover scalar, boolean, null, array, and object literals.
Changed Files
src/wf_core/models/steps.py: Added the canonical recursive finite JSON-value alias and used it forInputValueBinding.value.tests/core/test_canonical_node_bindings.py: Added category, recursion, rejection, boolean-distinction, and finite-number tests.tests/wf_contract_manifest/test_generate.py: Added manifest operation and recursiveJsonValueassertions; updated generated component count.contracts/workflow-api.manifest.json: Regenerated checked manifest.web/packages/rpc/scripts/workflow-contract-generator.ts: Added both focused methods to the runtime operation cohort.web/packages/rpc/scripts/workflow-contract-generator.test.ts: Added missing-operation and reachable-schema coverage for both methods and recursiveJsonValueoutput.web/packages/rpc/src/generated/workflow-contract.ts: Regenerated checked TypeScript contract.web/packages/rpc/src/json-schema/authored-rpc-fixtures.ts: Replaced object-only input literal validation with recursive JSON-value validation and added focused authored fixtures.web/packages/rpc/src/json-schema/runtime-schema.test.ts: Added focused runtime schema inventory and JSON literal coverage.web/packages/rpc/src/json-schema/rpc-parity.test.ts: Added both payload/result parity cases and canonical binding-union coverage.web/packages/rpc/src/rpcs.ts: Added schema-backedRpc.makedefinitions andWorkflowRpcsmembership.web/packages/rpc/src/service.ts: Added decode-before-dispatch cases for both operations.web/packages/rpc/src/method-registry.ts: Added metadata, interpretation, and replacement CLI evidence renderers.web/packages/rpc/src/index.ts: Added public operation and payload/result schema exports.web/packages/rpc/src/service.test.ts: Added representative request/response dispatch cases.web/packages/rpc/src/method-registry.test.ts: Added set-input/set-output, clear, and non-equivalent evidence assertions.web/apps/console/src/connection/contracts.ts: Added both operation names to the explicit browser DTO contract.web/apps/server/src/browser-operation-policy.ts: Added both names to the explicit browser allowlist.web/apps/server/src/browser-operation-policy.test.ts: Pinned the allowlist and continued rejecting generic/admin operations.web/apps/server/src/app.test.ts: Added one accepted request case per operation.
TDD Evidence
RED
- Initial brief commands passed the pre-existing tests: Python
25 passed; generator8 passed, demonstrating the missing behavior was not previously asserted. - After adding canonical/generator tests, Python failed
3targeted tests: unconstrainedobjecthad no recursive$defsand acceptedobject(); the manifest value had noanyOf. Generator failed3tests because both operations were absent from the runtime cohort. - After adding RPC/server tests, the RPC focused run failed
8tests: both service operations were unknown, both registry entries were missing, and the authored RPC catalog did not contain the new methods. The requested@lda/serverpnpm selector did not exist in this workspace. - The finite-number test then failed all
3cases before switching the canonical alias toFiniteFloat.
GREEN
- Canonical/manifest Python suite:
38 passed. - Contract generator suite:
11 passed. - Focused RPC suite:
66 passed. - Focused server suite:
32 passed.
Verification
pnpm --dir web --filter @lda/workflow-rpc typecheck: passed.pnpm --dir web --filter @lda/web-server typecheck: passed.pnpm --dir web --filter @lda/workflow-rpc contract:check: passed.- Touched-file
uv run ruff check: passed. - Touched-file
uv run ruff format --check: passed. - Touched-file
uv run basedpyright --level error:0 errors, 0 warnings, 0 notes. git diff --check: passed; only Git line-ending warnings were reported.
Deviations
- The brief names the server package
@lda/server; the current workspace package is@lda/web-server, so the equivalent focused test and typecheck commands used@lda/web-server. - Repository-wide
uv run ruff format --checkis not clean because unrelated pre-existing files undersrc/wf_api/would be reformatted. They were not changed. - Repository-wide
uv run basedpyright --level errorreports353errors across the existing project. The touched Python files were checked separately and have zero diagnostics.
Concerns
- Parity continues to report the translator's existing
oneOfblockers for structural path unions. The new focused payloads add the correspondingInputPathBinding.pathandOutputBinding.sourceblocker entries; authored and manifest acceptance remains aligned for tested values. - No Serena configuration was modified, and no generated output was hand-edited.
Round 1/5 Review Fix
Changed Files
src/wf_core/models/steps.py: MadeInputValueBindingstrict and added a recursive pre-validator that rejects tuples, sets,Decimal, non-string object keys, and non-finite numbers without coercion while retaining finite recursive JSON values and the existing generated schema.tests/core/test_canonical_node_bindings.py: Added rejection coverage for tuple, set,Decimal, and non-string-key values.web/packages/rpc/src/json-schema/authored-rpc-fixtures.ts: Added a sharedSchema.String.pipe(Schema.minLength(1))path segment schema to every checked structural input/output binding path.web/packages/rpc/src/json-schema/rpc-parity.test.ts: Added authored decode tests for empty segments in input path, input value target, output source, and output target, plus checked-manifest component assertions for all five structural path fields.
RED
- Before the production edits, the new Python test failed 3 cases: tuple, set, and
Decimalwere coerced; the non-string-key case already failed under the existing recursive validator. - Before the Effect fixture edit, the new parity test accepted an empty
InputPathBinding.pathsegment.
GREEN
uv run pytest tests/core/test_canonical_node_bindings.py -q:36 passed.pnpm exec vitest run src/json-schema/rpc-parity.test.ts:5 passed.
Verification
- Focused RPC runtime/parity/generator tests:
28 passed. - RPC package typecheck: passed.
- Checked contract verification: passed with
All checks passed!. - Touched-file Ruff and basedpyright checks: passed; basedpyright reported
0 errors, 0 warnings, 0 notes. git diff --check: passed; only Git line-ending warnings were reported.
Deviations
- No generated output changed: strict Pydantic validation and authored fixture constraints preserve the existing checked contract, so the contract check was run without rewriting generated files.
Concerns
- The pre-existing translator blockers for structural
oneOfpath unions remain unchanged; this round only tightens authored decode parity and confirms the checked componentminLengthconstraints.