Skip to content

Standardize management payload validation (codex) - #2354

Merged
numnx merged 1 commit into
feature/CODUX-142-qs-code-quality-performance-audit-6from
task/feature-codux-142-qs-code-quality-performance-au-t09-codex-mr9j5s0u
Jul 6, 2026
Merged

Standardize management payload validation (codex)#2354
numnx merged 1 commit into
feature/CODUX-142-qs-code-quality-performance-audit-6from
task/feature-codux-142-qs-code-quality-performance-au-t09-codex-mr9j5s0u

Conversation

@numnx

@numnx numnx commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Standardize management payload validation

Automated task PR opened by Code UX for T09.

📋 Summary

Sprint: Sprint 142 · QS: Code Quality & Performance Audit · Task: T09

Audit and improve Code UX quality and performance by tightening existing hot-path contracts across live snapshots, execution projection, provider telemetry, dashboard render derivation, repository boundaries, MCP validation, guardrails, and documentation.

📝 Full Task Prompt
## Objective
Improve MCP management API reliability by centralizing one remaining cluster of ad hoc payload parsing into `payload-parsers.ts` and covering validation errors with focused tests.

## Scope
- Edit `src/mcp/management/payload-parsers.ts`
- Edit one or more management action files with local ad hoc parsing after inspection: `src/mcp/management/task-actions.ts`, `src/mcp/management/sprint-actions.ts`, `src/mcp/management/project-actions.ts`, `src/mcp/management/settings-actions.ts`, or `src/mcp/management/memory-actions.ts`
- Edit the corresponding focused tests under `tests/backend/mcp/`, such as `tests/backend/mcp/management-task-actions.test.ts`, `tests/backend/mcp/management-project-actions.test.ts`, or `tests/backend/mcp/management-sprint-actions.test.ts`
- Update `docs/mcp/tools-and-contracts.md` if request semantics for null versus undefined are clarified

## Implementation Requirements
1. Search the listed management action files for duplicated required string, optional string, enum, number, boolean, array, or patch-value parsing that bypasses existing parser helpers.
2. Add narrowly scoped parser helpers to `payload-parsers.ts` only for repeated patterns found in real action files, preserving trim behavior and explicit `null` versus `undefined` semantics.
3. Refactor the selected action handlers to use the shared parser helpers and keep approval-envelope/error response shapes unchanged.
4. Add tests for success, missing required value, invalid enum/type, and explicit null handling for the refactored action path.

## Constraints
- Do not rename MCP tools or change public action names.
- Do not broaden the task to every management action file; refactor one coherent duplicated parsing cluster with tests.
- Preserve existing validation error wording where tests or docs depend on it, unless the new wording is more consistent and tests are updated intentionally.
- Do not change repository write behavior behind the actions.

## Verification
- Run the focused MCP management test file(s) touched, for example `pnpm exec vitest run tests/backend/mcp/management-task-actions.test.ts`.
- Run `pnpm run lint`.
- Success means the selected action path uses shared parser helpers and tests cover consistent success and validation failure envelopes.

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-06 18:05:10 UTC
Finished 2026-07-06 18:09:39 UTC
Duration 4m 30s

📊 Token Usage

Metric Value
Input tokens 109,526
Cached input tokens 806,016
Output tokens 6,043
Total tokens 921,585
Invocations 1
Tool calls 34
Active time 2m 41s

Included usage estimate (subscription/local login): $1.13

🌿 Branch Info

Base: feature/CODUX-142-qs-code-quality-performance-audit-6
Head: task/feature-codux-142-qs-code-quality-performance-au-t09-codex-mr9j5s0u


🤖 Generated by Code UX

@numnx
numnx merged commit 3a2ee36 into feature/CODUX-142-qs-code-quality-performance-audit-6 Jul 6, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-142-qs-code-quality-performance-au-t09-codex-mr9j5s0u branch July 6, 2026 18:12
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.

1 participant