Files
dxdesigner-part-replacement/docs/superpowers/plans/2026-10-30-dsh-operations.md
T

5.0 KiB

DSH Operations Implementation Plan

For agentic workers: Use executing-plans for integration and dispatching-parallel-agents for the independent domain modules. Track the items below and verify each deliverable before integration.

Goal: Implement all seven approved operations improvements in the existing DSH assistant.

Architecture: Qt owns execution and confirmation. Independent Qt-free stores own durable state and read-only analyses. Harness schemas and native slots expose bounded capabilities without changing the business persona.

Tech Stack: Python 3, SQLite/atomic JSON, PySide6, Node 24 and official Harness 0.2.1-rc.5.

Spec: docs/superpowers/specs/2026-10-30-dsh-operations.md.

Constraints

  • Work only in .worktrees/codex-dsh; retain shared checkout and other branches.
  • Never log credentials, stage bootstrap/provider files, invent CAD counts or weaken interruption/confirmation gates.
  • Native right dock, model tools and parent-process protocol must expose each completed feature; domain-only code is insufficient.

Deliverables and interfaces

  • dsh/run_journal.py: RunJournal(data_root).begin(run_id, task_ids, plan_hashes, *, schedule_id=None) -> dict, .finish(run_id, result), .list_runs(limit=20), .get(run_id), .inspect(service, run_id) -> dict. Records contain run_id, queue_id=run_id, ordered task_ids, plan_hashes, status, UTC timestamps and result. Inspect returns actual counters/blockers and resume scope without starting work.
  • dsh/scheduling.py: ScheduleStore(data_root).save(spec, plan_hashes) -> dict, .list_schedules(), .get(schedule_id), .cancel(schedule_id), .claim(schedule_id), .finish(schedule_id, status, **values), .evaluate(service, *, now=None, busy=False) -> list[dict]. Spec uses task_ids, priority (low/normal/high/urgent), not_before, optional due_at, dependencies, auto_start, and optional title. No external calls or actual execution from this module.
  • dsh/experience.py: ExperienceStore(data_root).refresh() -> list[dict], .search(issue_code='', *, limit=5) -> list[dict], .summary() -> dict. Derive entries from existing incidents and preserve explicit verification and evidence identity.
  • dsh/ticket_tracking.py: TicketTracker(data_root).refresh(incident_id) -> dict, .list_tickets() -> list[dict]. Use GitIssuePublisher.connection() and protected fixed-target read requests; no arbitrary URL or writing capability.
  • dsh/impact.py: execution_impact(service, task_ids, *, limit=100) -> dict. Exact selected component rows for saved target plans; mapping-only rows with component_count=None, coverage='mapping_only'. Include totals, omitted-row count and fingerprint/hash references.
  • Integrate run journal/resume and checkpoint reservation into task_queue.py and ui/dsh_task_lifecycle.py; keep all execution receipt counts and existing safety gates.
  • ui/dsh_operations.py owns scheduling, recovery/history, impact, experience and ticket requests and native dialogs. Initialize it on desktop startup without loading Chromium; publish data when Harness opens. Timer uses existing worker lane, preserves model turns and does not invoke model APIs on each tick.
  • Runtime usage module records native session events and honors configurable response timeout/cancel without cancelling confirmed CAD writes. Bound and cache unchanged task reads while preserving audit evidence.
  • Extend context, tool schemas, guard roster, right dock, tool settings and direct UI actions. Keep automatic agents snapshot-only. Expose usage limits as tool settings with explicit units and unknown price handling.
  • Verify tests first for each domain, integrate, run regressions and real CLI/Qt/CDP acceptance, document actual results and commit to codex/dsh.

Verification recipes

Each new domain test starts by exercising a missing module/API (expected failure), then verifies durable behavior against temporary real stores and fixture services. Integration tests use existing tests/ui/conftest.py controlled executor and actual Qt confirmation clicks. Run:

pytest -q tests/dsh tests/ui tests/v1_1/test_task_queue.py tests/packaging/test_dx_part_replace_build.py
pytest -q tests/v1_1/test_execution_feedback.py
node tools/verify_dsh_runtime.mjs

Complete real-model acceptance with isolated fixtures and existing Qt/CDP driver, including reload/restart, known versus unknown impact, due scheduling, safe pause and ticket refresh. Report controlled-executor limits explicitly.

Verified result

All seven operations are integrated in the native dock and schema surface. Final regression: 277 passed across three processes (193 + 2 + 82); same-name test modules run separately. CLI runtime, dock startup, bounded model results, native usage/compaction and real two-process Qt/CDP acceptance passed. The acceptance resumed the original queue and dispatched one explicitly authorized schedule exactly once using controlled no-match fixtures. See docs/testing/2026-10-30-dsh-operations.md for evidence and limits. No release EXE was built.