diff --git a/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-1-report.md b/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-1-report.md deleted file mode 100644 index 0911ecc9..00000000 --- a/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-1-report.md +++ /dev/null @@ -1,108 +0,0 @@ -# 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 for `InputValueBinding.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 recursive `JsonValue` assertions; 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 recursive `JsonValue` output. -- `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-backed `Rpc.make` definitions and `WorkflowRpcs` membership. -- `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`; generator `8 passed`, demonstrating the missing behavior was not previously asserted. -- After adding canonical/generator tests, Python failed `3` targeted tests: unconstrained `object` had no recursive `$defs` and accepted `object()`; the manifest value had no `anyOf`. Generator failed `3` tests because both operations were absent from the runtime cohort. -- After adding RPC/server tests, the RPC focused run failed `8` tests: both service operations were unknown, both registry entries were missing, and the authored RPC catalog did not contain the new methods. The requested `@lda/server` pnpm selector did not exist in this workspace. -- The finite-number test then failed all `3` cases before switching the canonical alias to `FiniteFloat`. - -### 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 --check` is not clean because unrelated pre-existing files under `src/wf_api/` would be reformatted. They were not changed. -- Repository-wide `uv run basedpyright --level error` reports `353` errors across the existing project. The touched Python files were checked separately and have zero diagnostics. - -## Concerns - -- Parity continues to report the translator's existing `oneOf` blockers for structural path unions. The new focused payloads add the corresponding `InputPathBinding.path` and `OutputBinding.source` blocker 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`: Made `InputValueBinding` strict 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 shared `Schema.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 `Decimal` were 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.path` segment. - -### 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 `oneOf` path unions remain unchanged; this round only tightens authored decode parity and confirms the checked component `minLength` constraints. diff --git a/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-2-report.md b/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-2-report.md deleted file mode 100644 index c54b98f8..00000000 --- a/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-2-report.md +++ /dev/null @@ -1,133 +0,0 @@ -# Task 2 Report - -## Outcome - -Task 2 is implemented on `main`. The console now has a pure selected-step -projection for keyed and compiled drafts, parser-first canonical input/output -binding handling, unsupported-row preservation, ordered row serializers, -schema-informed suggestions and source previews, structural diagnostic mapping, -and presence-aware setup metadata projection. - -## Changed Files - -- `web/apps/console/src/workspace/domain/draft-workspace-models.ts`: Added `StatePath`, `OutputBinding`, and focused input/output binding mutation input types. -- `web/apps/console/src/workspace/authoring/selected-step-dataflow.ts`: Added canonical projection, structural path guards, row projections, single-row and list serializers, schema helpers, preview selection, and diagnostic ownership mapping. -- `web/apps/console/src/workspace/authoring/selected-step-dataflow.test.ts`: Added keyed/compiled equivalence, ordering, null/zero/absent metadata, structural paths, malformed rows, output target rejection, serializer save blocking, suggestions, previews, and positive/negative diagnostic tests. -- `web/apps/console/src/workspace/authoring/canonical-capability-form.ts`: Preserved absent setup metadata as omitted properties without synthesizing nulls in the binding projection. -- `web/apps/console/src/workspace/authoring/canonical-capability-form.test.ts`: Added absent, explicit-null, and numeric-zero metadata tests. -- `.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-2-report.md`: This report. - -## TDD Evidence - -### RED - -After writing the pure projection and setup tests, the prescribed command failed -before collecting tests because `selected-step-dataflow.ts` did not exist: - -```text -Test Files 1 failed (1) -Tests no tests -Error: Failed to resolve import "./selected-step-dataflow.js" -``` - -This was the expected missing-production-module failure from the Task 2 brief, -not a test assertion or environment failure. - -### GREEN - -The first implementation run exposed five behavior/type defects. They were -fixed test-first: structural state path segments were preserved, structural -input roots were included during serialization, missing previews returned -`null`, focused diagnostics honored the requested field, and array-item target -suggestions were asserted. The final focused run passed: - -```text -Test Files 2 passed (2) -Tests 10 passed (10) -``` - -## Verification - -- `pnpm --dir web --filter @lda/console test -- src/workspace/authoring/selected-step-dataflow.test.ts src/workspace/authoring/canonical-capability-form.test.ts`: passed, `10/10`. -- `pnpm --dir web --filter @lda/console test -- src/workspace/authoring/selected-step-dataflow.test.ts src/workspace/authoring/canonical-capability-form.test.ts src/workspace/authoring/ContextInspector.test.tsx src/workspace/authoring/CapabilityNodeForm.test.tsx`: passed, `17/17`. -- `pnpm --dir web --filter @lda/console typecheck`: passed. -- `git diff --check`: passed; Git reported only normal LF/CRLF conversion warnings for modified files. -- No Serena configuration was modified. - -## Deviations - -- No controller, transport, or React dataflow forms were added. Those are later - plan tasks; Task 2's exact file list is limited to the domain models, pure - projection module/tests, and canonical setup projection/tests. -- The compiled fixture uses the repository's actual `nodes[]` capability key, - `node`, while keyed drafts use `use`. -- The list serializers return `null` while unsupported rows remain, providing the - pure save-blocking behavior needed by later forms; removing unsupported rows - before serialization is the explicit repair path. - -## Concerns - -- `bindingDiagnosticsForStep` receives only diagnostics, `stepId`, and field, so - it conservatively anchors `nodes[N]` ownership to the first matching selected - step node diagnostic. If a backend sends a node-indexed diagnostic without a - matching `step_id` or without another selected-step node anchor, it remains - unmatched rather than risking assignment to the wrong row. The keyed JSON - Pointer and focused `bindings[M]` forms do not have this limitation. -- Literal input values remain typed as the existing domain `unknown`; the - generated RPC/runtime contract remains authoritative for recursive JSON-value - validation at transport time. - -## Round 1/5 Review Fix - -### Changed Files - -- `web/apps/console/src/workspace/authoring/selected-step-dataflow.ts`: Added strict JSON Pointer segment decoding, non-negative decimal array-index traversal, explicit `compiledNodeIndex` projection context, and recursive finite JSON literal validation. -- `web/apps/console/src/workspace/authoring/selected-step-dataflow.test.ts`: Added regression coverage for invalid `~2` escapes, array `items.1` traversal and non-index rejection, compiled diagnostics with only the row diagnostic present, wrong node indexes, and invalid recursive literal values. -- `.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-2-report.md`: Appended this review round. - -### RED - -Before the production fixes, the focused pure-module run reported `5` failed -tests out of `10`: the projection lacked `compiledNodeIndex`, `isJsonValue` was -not exported, `items.1` preview returned `null`, invalid pointer escapes were -accepted as row locations, and a wrong compiled node index was not kept -unmatched. The failures were assertion failures against the intended behavior, -not test collection or type errors. - -### GREEN - -After the fixes: - -```text -Test Files 1 passed (1) -Tests 10 passed (10) -``` - -`SelectedStepDataflow.compiledNodeIndex` is now `null` for keyed drafts and the -selected `nodes[]` index for compiled drafts. `bindingDiagnosticsForStep` takes -that explicit index and never derives ownership from another diagnostic. - -### Verification - -- `pnpm --dir web --filter @lda/console test -- src/workspace/authoring/selected-step-dataflow.test.ts`: passed, `10/10`. -- `pnpm --dir web --filter @lda/console typecheck`: passed. -- `git diff --check`: passed; only normal Git LF/CRLF conversion warnings were reported. -- No Serena configuration was modified. - -### Deferred Cross-Task Acceptance - -The existing `ContextInspector` branch still uses the older canonical -capability-binding projection and can drop malformed input rows. This is not -resolved in Task 2. Task 7 must replace that selected-capability branch with -`SelectedCapabilityInspector` and test that it consumes -`inputBindingRows(...)` and `outputBindingRows(...)`, preserving unsupported -rows and the explicit save gate. - -### Concerns - -- The pure diagnostic helper now conservatively leaves compiled node paths - unmatched when the caller supplies `null` or a wrong node index. This is - intentional: ownership is explicit rather than inferred from unrelated - diagnostics. -- Literal validation is client-side recursive finite JSON validation; the - generated transport contract remains authoritative at the RPC boundary. diff --git a/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-6-report.md b/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-6-report.md deleted file mode 100644 index 946f4450..00000000 --- a/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-6-report.md +++ /dev/null @@ -1,68 +0,0 @@ -# Task 6 Report - -## Status - -Implemented the standalone ordered output-to-state binding form with schema suggestions, strict `state.*` targets, custom local paths, inferred previews, ordering controls, fan-out preservation, explicit clear confirmation, unsupported-row repair gating, row diagnostics, accessible labels, and responsive inspector styling. - -## Commit - -`feat: edit capability output bindings` - -## Verification - -- Focused Vitest: 7 tests passed. -- Console typecheck: passed. -- Staged diff check: passed. -- React Doctor changed scope: 100/100, no issues. - -## Concerns - -None. - -## Fix Round 3/5 - -### Status - -Extended each parameterized add, edit, and remove case to verify stale confirmation removal, fresh confirmation creation, empty-list submission, and cleared mutated-row UI state. - -### Tests - -- Focused Vitest: 15 tests passed. -- Console typecheck: passed. -- `git diff --check`: passed with only the repository CRLF conversion warning. - -### Concerns - -None. - -## Fix Round 2/5 - -### Status - -Added concise parameterized regressions proving add, edit, and remove actions cancel pending clear confirmation and preserve the mutated rows on save. No production changes were required. - -### Tests - -- Focused Vitest: 15 tests passed. -- Console typecheck: passed. -- `git diff --check`: passed with only the repository CRLF conversion warning. - -### Concerns - -None. - -## Fix Round 1/5 - -### Status - -Fixed pending-clear confirmation invalidation across non-confirm-clear mutations, replaced the colliding `__custom__` source sentinel with collision-proof indexed source selections, and corrected structural `state.*` path round-tripping. - -### Tests - -- Focused Vitest: 12 tests passed. -- Console typecheck: passed. -- `git diff --check`: passed with only the repository CRLF conversion warning. - -### Concerns - -None. diff --git a/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-7-report.md b/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-7-report.md deleted file mode 100644 index 2d82aa52..00000000 --- a/.superpowers/sdd/2026-08-09-workflow-console-selected-step-dataflow/task-7-report.md +++ /dev/null @@ -1,178 +0,0 @@ -# Task 7 Report - -## Status - -Implemented and committed as `7453d6b2` (`feat: edit selected-step dataflow`). - -## Delivered - -- Extracted the selected-node branch from `ContextInspector` into - `SelectedCapabilityInspector` with stable Setup, Inputs, and Outputs tabs. -- Passed `inputBindingRows` and `outputBindingRows` directly into the binding - forms. Unsupported persisted rows remain visible in repair UI and block Save - and Clear through the existing form guards. -- Preserved controller ownership of canonical mutations while keeping local - form state mounted across mobile inspector close/reopen. Selected step changes - remount the inspector by step id and rehydrate canonical rows. -- Added regression coverage for unsupported-row Save blocking, unique - diagnostics across mounted forms, mobile tab/unsaved-row persistence, and - selected-step rehydration. -- Added truthful authoring graph summaries for canonical input and output row - counts, preserving node detail text and generic graph handles. -- Updated the console README and roadmap, and archived the completed plan. - -## Verification - -- Focused Task 7 command: passed, 7 files and 55 tests. -- A prior `pnpm --dir web --filter @lda/console test` run recorded two - presentation test failures: one audience pairing test timed out and one - found two pairing buttons. -- `pnpm --dir web typecheck`: passed. -- `pnpm --dir web build`: passed with the existing large-chunk warning. -- `npx react-doctor@latest --verbose --scope changed`: passed, 100/100. -- `git diff --check`: passed. -- Browser smoke: not run. Local ports 8765 and 5173 were listening, but the - available browser runtime reported that no browser was available, so no - `.visual-smoke/` evidence was created. -- A prior `pnpm --dir web test` run recorded an RPC generated-contract count - mismatch: the test expected 22 operations while the generated contract - exposed 24. The current dirty controller-owned test edit prevents attributing - that result to the intended controller state. - -## Fix Round 1 - -Committed as `14892e89` (`fix: close selected-step dataflow review gaps`). - -Addressed the review findings: - -- Dagre now assigns content-aware heights for node references, details, and - summaries, with a connected-node spacing regression. -- Array-shaped compiled authoring nodes receive the same canonical binding - summary as keyed steps. -- The real `DraftWorkbench` graph selection boundary now proves Setup, Inputs, - and Outputs rehydrate between two nodes without a test-supplied key. -- Composition coverage now proves unsupported output rows remain visible and - block both Save and Clear until removal, after which the ordered payload is - submitted. - -Fix-round verification: the focused Task 7 command passed with 7 files and 58 -tests; `pnpm --dir web typecheck` passed; `git diff --check` passed. - -The current worktree contains a controller-owned edit to -`web/packages/rpc/src/generated/workflow-contract.test.ts`; it was not touched -or staged in this fix round. The final controller should rerun the full suite -and browser acceptance against the intended controller state. Browser smoke and -`.visual-smoke/` evidence remain pending until a browser-capable environment is -available. - -## Fix Round 2 - -Committed as `ee703976` (`fix: sync draft route freshness`). - -The real-browser stale-header finding is addressed by a minimal freshness seam: -`DraftWorkbench` reports its controller-owned canonical draft to -`DraftDetailRoute`; the route uses that snapshot for immediate header updates, -then lets later loader snapshots, workspace changes, and disconnected states -replace it. Workspace ids gate callbacks so an old workbench cannot leak state -into another route. - -Regression coverage proves immediate revision/status synchronization, loader -refresh precedence, no cross-workspace leak, and the workbench callback seam. -Focused verification passed: 8 files and 60 tests, `pnpm --dir web typecheck`, -and `git diff --check`. - -## Fix Round 3 - -Committed as `1e671ed7` (`test: cover draft route freshness integration`). - -The route regression now mounts the real `DraftWorkbench` and its authoring -controller, using mocked capability/loader transport only at the route boundary. -The integration path performs a real setup mutation and verifies that the -header immediately reflects the committed revision and status, then verifies -that a newer loader draft replaces that optimistic snapshot. It also exercises -loading and disconnected replacement, navigates to a second workspace through -the router, invokes the retained old callback, and proves the new workspace -header cannot be overwritten. The test bounds workbench renders to catch -freshness update loops. The route freshness guard uses loader source generation -so callbacks from an earlier draft, phase, or workspace cannot cross the -boundary. - -Fix-round verification passed: - -- Focused console command: 3 files and 20 tests. -- `pnpm --dir web --filter @lda/console typecheck`. -- `git diff --check`. - -The controller-owned dirty edit to -`web/packages/rpc/src/generated/workflow-contract.test.ts` remained untouched -and unstaged. The final controller will rerun the full suite and browser -acceptance against the intended controller state. - -## Fix Round 4 - -The route integration test now invokes a retained callback after a newer loader -generation for the same `draft-report` workspace and again after a -disconnect/reconnect cycle. Both assertions prove the revision 3 loader snapshot -remains authoritative without relying on the workspace-id guard. The existing -cross-workspace callback check remains a separate identity-gate assertion. - -The permissive render-count ceiling was replaced with exact stabilization -checks after mutation synchronization, loader refresh, reconnect, and -navigation. Each check records the settled workbench render count, advances an -event-loop tick, and requires the count to remain unchanged. - -A mutation check temporarily removed the `loaderGenerationRef` predicate while -leaving the workspace-id predicate intact. The focused test failed because the -same-workspace stale callback regressed the header from revision 3 to revision -99; production was then restored unchanged. - -Fix-round verification passed: - -- Focused console command: 3 files and 20 tests. -- `pnpm --dir web --filter @lda/console typecheck`. -- `git diff --check`. - -The controller-owned dirty edit to -`web/packages/rpc/src/generated/workflow-contract.test.ts` remained untouched -and unstaged. - -## Final Browser Acceptance - -The controller subsequently ran the real browser path against the live console, -Hono bridge, and workflow RPC service on ports 5173, 8787, and 8765. The -disposable workspace `codex_bind_smoke_0810` verified: - -- setup updates omit blank retry/timeout fields and advance the revision; -- literal input replacement persists; -- ordered output fan-out persists after reload; -- clearing outputs preserves the projected state schema; -- the route header shows the committed revision without a reload; and -- Setup, Inputs, and Outputs remain available in the mobile inspector. - -The gitignored evidence is recorded under -`web/apps/console/.visual-smoke/selected-step-dataflow-evidence.md` with desktop -and mobile screenshots in the same directory. - -## Final React Ownership Cleanup - -Commit `070cbe6d` moved the route identity header beside the workbench's -canonical controller state. It supersedes the route-level draft mirror, -render-time generation refs, and child-to-parent effect while retaining the -same immediate mutation and loader-replacement behavior. The focused route and -workbench tests pass, and React Doctor reports 100/100 for the changed files. - -## Final Whole-Slice Fix Round - -Commit `167f080d` closes the valid Important findings from the whole-slice -review. Persisted binding containers and rows are now strict and unsupported -data stays visible; Inputs expose workflow/capability schema suggestions while -retaining free text; duplicate local targets receive row-owned errors; timeout -values match the positive-integer transport contract; and removing the final -output row routes Save through the explicit clear confirmation. - -The focused authoring suite passed with 65 tests, and console typecheck and the -commit diff check passed independently after the implementation worker finished. -The controller also reopened the live disposable draft after the fix: a `0.5` -timeout was rejected locally, capability targets offered `.` and `message`, and -workflow sources offered `input.message`, `state.content`, and -`state.content_copy` from the live workflow schemas. diff --git a/.superpowers/sdd/2026-08-11-workflow-console-capability-playground/task-4-report.md b/.superpowers/sdd/2026-08-11-workflow-console-capability-playground/task-4-report.md deleted file mode 100644 index acb5a271..00000000 --- a/.superpowers/sdd/2026-08-11-workflow-console-capability-playground/task-4-report.md +++ /dev/null @@ -1,116 +0,0 @@ -# Task 4 Report: Bound and Redact Console Evidence - -## Scope - -Implemented against baseline `32c99cbe`. - -Task 4 adds the pure retention and security boundary for console evidence. It -does not change transport response decoding, Python code, Serena configuration, -or UI styling. - -## Implementation - -- Added `sanitizeEvidenceValue`, `sanitizeEvidenceRecord`, and `retainEvidence` - in `web/apps/console/src/workspace/domain/evidence-policy.ts`. -- Redaction is case-insensitive and happens before reading sensitive property - values. Keys matching authorization, cookie, token, password, secret, - credential, API-key, or private-key patterns become `[redacted]`. -- The projector is immutable and JSON-safe. It handles cyclic references, - throwing getters, unsupported values, non-finite numbers, bounded depth, - bounded strings, and bounded collection entries. -- Sanitized request and response values each receive an independent 32 KiB - UTF-8 JSON byte budget. The independent budgets preserve request context when - only the response is oversized. The byte fitter is deterministic and uses - `[truncated: depth limit]` and `[truncated: evidence limit]` markers. -- Reducer evidence retention now sanitizes the incoming record and keeps only - the newest 100 records. -- `EvidenceRecord` now requires `target`. Shared read/write executor evidence - records use `options.target` on success, invocation failure, server failure, - protocol/decode failure, and operation mismatch. Health, live demo, replay, - and test fixtures provide target attribution as well. - -## TDD Evidence - -The initial policy test run failed because the policy module did not exist, and -the new reducer retention assertion observed the old unbounded 101-record -behavior. After the minimal implementation, the policy and reducer tests -passed. A depth test was corrected to use an acyclic deep chain rather than a -cycle, preserving separate coverage for depth and circular-reference markers. - -## Verification - -- `pnpm --dir web --filter @lda/console test -- src/workspace/domain/evidence-policy.test.ts src/workspace/domain/read-executor.test.ts src/workspace/domain/write-executor.test.ts src/app/state.test.ts` - - PASS: 4 files, 47 tests -- `pnpm --dir web --filter @lda/console test` - - PASS: 144 files, 1,223 tests -- `pnpm --dir web --filter @lda/console typecheck` - - PASS -- `pnpm --dir web --filter @lda/console build` - - PASS -- `git diff --check` - - PASS - -## Concerns - -- The production build reports the pre-existing Vite warning about a minified - chunk larger than 500 kB; this task did not alter bundling or UI structure. -- Presentation replay evidence uses the explicit target label `replay`, while - live demo evidence records its connected target. - -## Fix Round 1 - -Review findings addressed: - -- Routed presentation replay initialization and live evidence appends through - the existing `retainEvidence` policy boundary. Initial replay projection now - sanitizes each record and retains only the newest 100; live appends use the - same function rather than a second retention implementation. -- Replaced the unanchored redaction regex with exact case-insensitive matching - for only: `authorization`, `cookie`, `set-cookie`, `token`, `access_token`, - `refresh_token`, `secret`, `password`, `api_key`, and `api-key`. -- Added coverage for every approved key variant, plus unchanged - `tokenCount`, `authorizationStatus`, `cookieJar`, and `secretary` keys. -- Added presentation projection coverage for sanitized initial replay evidence - and newest-100 retention. - -Test files changed in this fix round: - -- `web/apps/console/src/workspace/domain/evidence-policy.test.ts` -- `web/apps/console/src/presentation/PresentationRoute.test.tsx` - -TDD RED command and output: - -```text -pnpm --dir web --filter @lda/console test -- src/workspace/domain/evidence-policy.test.ts src/presentation/PresentationRoute.test.tsx -FAIL: 2 failed, 93 passed (95 total) -- ordinary tokenCount was redacted -- projectRecordingToEvidence was not a function -``` - -Focused GREEN command and output: - -```text -pnpm --dir web --filter @lda/console test -- src/workspace/domain/evidence-policy.test.ts src/presentation/PresentationRoute.test.tsx -PASS: 2 files, 95 tests -``` - -Broader test command and output: - -```text -pnpm --dir web --filter @lda/console test -PASS: 144 files, 1,225 tests -``` - -Typecheck command and output: - -```text -pnpm --dir web --filter @lda/console typecheck -PASS: @lda/presentation-sync build; tsc -b --pretty false -``` - -Diff hygiene: - -```text -git diff --check -PASS: exit code 0 -``` diff --git a/.superpowers/sdd/2026-08-11-workflow-console-capability-playground/task-5-report.md b/.superpowers/sdd/2026-08-11-workflow-console-capability-playground/task-5-report.md deleted file mode 100644 index f8bfc63c..00000000 --- a/.superpowers/sdd/2026-08-11-workflow-console-capability-playground/task-5-report.md +++ /dev/null @@ -1,70 +0,0 @@ -# Task 5 Report: Add the Capability Call Domain Boundary - -## Scope - -Implemented against baseline `45ba9057`. This task adds only the Valibot -capability-call result model, executor-backed client, and stale-safe React -controller. No UI, Python, or Serena configuration changes were made. - -## TDD Evidence - -- RED: the domain tests failed because `decodeCapabilityCallResult` and the - capability-call client module were absent. -- GREEN: the focused domain tests passed with 2 files and 7 tests. -- RED: the controller test failed because `useCapabilityPlayground` was absent. -- GREEN: the controller tests passed with 1 file and 9 tests. - -## Implementation - -- Added the camel-case `CapabilityCallResult` Valibot decoder, including - `runtime_error` outcomes and dependency diagnostics. -- Added `callCapability`, lowering to snake-case through - `ConsoleExecutor.run("workflow.capabilities.call", ...)` only. Blank - deployment IDs are omitted. -- Added `useCapabilityPlayground` with disconnected, idle, calling, result, and - error phases; double-submit suppression; acknowledgement/deployment reset; - and generation plus selection-identity stale completion guards. - -## Verification - -```text -pnpm --dir web --filter @lda/console test -- src/workspace/domain/capability-models.test.ts src/workspace/domain/capability-call-client.test.ts src/workspace/routes/useCapabilityPlayground.test.tsx -PASS: 3 files, 16 tests - -pnpm --dir web --filter @lda/console typecheck -PASS - -git diff --check -PASS -``` - -## Concerns - -No functional concerns identified. The controller intentionally leaves -acknowledgement enforcement to the future playground UI while exposing and -resetting the acknowledgement state at this domain boundary. - -## Fix Round 1 - -### Review Finding Addressed - -Added direct coverage for changing from connected target A and executor A to -target B and executor B while a call is pending. The test asserts the idle -reset state, rejects the stale target-A promise without allowing an overwrite, -and verifies a subsequent target-B call completes successfully. - -### TDD Evidence - -The regression test was written before any production edit and passed -immediately, confirming the existing selection-identity and generation guards -already handled target/executor changes. No production change was warranted. - -### Verification - -```text -pnpm --dir web --filter @lda/console test -- src/workspace/routes/useCapabilityPlayground.test.tsx -PASS: 1 file, 10 tests - -pnpm --dir web --filter @lda/console typecheck -PASS -```