Skip to content

(CODUX-108) Build detached validation runtime - #2678

Merged
numnx merged 1 commit into
feature/CODUX-185-add-custom-data-dashboardsfrom
task/feature-codux-185-add-custom-data-dashboards-t02-codex-mraq6lwd
Jul 7, 2026
Merged

(CODUX-108) Build detached validation runtime#2678
numnx merged 1 commit into
feature/CODUX-185-add-custom-data-dashboardsfrom
task/feature-codux-185-add-custom-data-dashboards-t02-codex-mraq6lwd

Conversation

@numnx

@numnx numnx commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Build detached validation runtime

Automated task PR opened by Code UX for T02.

📋 Summary

Sprint: Sprint 185 · Add Custom Data Dashboards · Task: T02

Add a project-scoped Custom Dashboards system where the Project Manager agent can create dashboard bundles, validate them in detached Docker sessions connected to Code UX data, and publish only validated dashboards into the main dashboard UI.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-07 14:09:31 UTC
Finished 2026-07-07 14:21:34 UTC
Duration 12m 3s

📊 Token Usage

Metric Value
Input tokens 140,875
Cached input tokens 4,583,936
Output tokens 28,891
Total tokens 4,753,702
Invocations 1
Tool calls 74
Active time 11m 32s

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

✅ QA Review

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

📝 Full Task Prompt
## Objective
Add the server-side validation runtime that materializes a custom dashboard revision into an isolated workspace, builds it, starts it in a detached container/session, health-checks it, captures logs, and records pass/fail results.

## Scope
- Create `src/services/custom-dashboard-validation-service.ts`
- Create `src/services/custom-dashboard-validation-utils.ts` if helper extraction is needed
- Create `src/services/custom-dashboard-docker-plan.ts` if Docker argument construction should be isolated
- Edit `src/app/dependency-factory/core-factory.ts` to instantiate/export the validation service from the repository created by T01
- Reuse existing helpers from `src/services/sprint-preview-service.ts`, `src/services/docker-session-lifecycle.ts`, `src/services/cli-docker-utils.ts`, `src/services/cli-process-runner.ts`, and `src/infrastructure/providers/cli/docker-bootstrap-builder.ts`
- Add focused tests under `tests/backend/services/custom-dashboard-validation-service.test.ts`

## Implementation Requirements
1. Consume the T01 repository contract and implement `startValidation(projectId, dashboardId, revisionId)`, `getValidationSession(sessionId)`, `listValidationSessions(projectId, dashboardId?)`, `getValidationLogs(sessionId, tail?)`, `stopValidation(sessionId)`, and `removeValidation(sessionId)`.
2. Materialize each validation run into a project runtime directory such as `.code-ux/runtime/custom-dashboards/<dashboardId>/<revisionId>/workspace`, write the persisted files plus a generated Vite/Preact harness, and inject a read-only Code UX data bridge configuration for dashboard data, integrations, and declared external API nodes.
3. Run dependency install/build/start commands inside Docker using the configured CLI workflow image, poll a health endpoint or root URL until ready, capture build/start failures and container logs, and persist structured validation reports back through the repository.
4. Mark validation passed only when install/build/start and health checks succeed; otherwise record failed status, last error, and log excerpts without changing publication state.
5. Ensure validation sessions are detached and reusable from the main dashboard by persisting host port, container id/name, validation URL path, created timestamps, and latest status.

## Constraints
- Do not publish or activate dashboards from this service; successful validation only marks the revision as validated.
- Do not mutate sprint preview sessions or reuse the `sprint_preview_sessions` table.
- Do not mount provider credentials unless existing Docker credential mount settings explicitly allow them.
- Bound log capture and proxied body sizes consistently with sprint preview patterns.

## Verification
- Run `pnpm run lint`.
- Run `pnpm run test:backend -- tests/backend/services/custom-dashboard-validation-service.test.ts`.
- Success means failed builds cannot pass validation, successful mocked builds update the validation session and revision report, logs are retrievable, and stop/remove clean up session state.
🌿 Branch Info

Base: feature/CODUX-185-add-custom-data-dashboards
Head: task/feature-codux-185-add-custom-data-dashboards-t02-codex-mraq6lwd


🤖 Generated by Code UX

@numnx
numnx merged commit 018fbf1 into feature/CODUX-185-add-custom-data-dashboards Jul 7, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-185-add-custom-data-dashboards-t02-codex-mraq6lwd branch July 7, 2026 14:24
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