Skip to content

Fix : Run lifeCycle & other little things#116

Merged
DocRoms merged 1 commit into
mainfrom
fix/run-lifecycle
Jul 13, 2026
Merged

Fix : Run lifeCycle & other little things#116
DocRoms merged 1 commit into
mainfrom
fix/run-lifecycle

Conversation

@DocRoms

@DocRoms DocRoms commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Fix few other things to improve Application stability

Changes

Run lifecycle

  • Run status state machine locked — status guards + atomic claims on every writer
  • Resume Interrupted runs — UI button, API endpoint, MCP tool, atomic claim
  • Foreach resume reconciliation — 3-source done-set (git ledger, child runs, state)
  • First-step resume re-attaches its worktree — no duplicate worktree creation

Observability

  • kronn::invariant tracing target — blocked writes, frozen counters, refused fetches, broken envelopes, boot probe
  • Exact Ollama prompt-truncation detectionprompt_eval_count vs num_ctx

Envelope contract

  • Embedded end-marker bug fixed — foreach output no longer breaks downstream refs
  • Degenerate-output corpus + no-panic fuzz sweep on the extractor

Typegen (TD-20260701 resolved)

  • generated.ts fully auto-generated — 281 types, deterministic assembler
  • Faithful serde→TS optionality transform — request types scanned from Rust source
  • CI drift guard — regenerate + git diff --exit-code
  • Generator fidelity + hygiene tests

API calls (TD-20260630 resolved)

  • LinkHeader pagination — GitHub-style bare arrays + rel="next" walking
  • Same-origin guard on next links — no auth leak to foreign hosts

Security / P2P

  • Invite-code auth requires an accepted contact — no oracle for pending/refused
  • Every DELETE gated even with auth off — verb-based destructive criterion
  • X-Real-IP trusted only in Docker — LAN spoof bypass closed
  • Zip-bomb-safe config import — per-entry decompressed caps
  • Export format v5 — QP version history + learning rejection counters round-trip (v4-compatible)

Test suite & DX

  • Tests can no longer clobber the real config.toml — isolation + write chokepoint guard
  • cargo test no longer opens a browser tab — open-url test-binary guard
  • Backend suite fully stabilized — env races serialized, lock flake root-caused
  • Codex gpt-5.6 model tiers — sol/terra/luna + 5.5/5.4 suggestions and fallbacks
  • Room source verification (lint-MCP) — agent MCP messages linted like streamed replies

Docs

  • ADR-001 — SQLite connection model (separate read connection deferred post-0.9)
  • Release docs aligned on 0.8.11 — changelog, readmes, site

@DocRoms DocRoms requested a review from Copilot July 13, 2026 14:24
@DocRoms DocRoms added the ci-test Start all the CI Test steps label Jul 13, 2026
@DocRoms DocRoms self-assigned this Jul 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a broad stability/hardening bundle that (1) makes frontend/src/types/generated.ts fully auto-regenerated from Rust ts-rs bindings, (2) adds “resume Interrupted run” support end-to-end (UI → API → runner) with stronger run-status guards and foreach reconciliation, and (3) tightens multiple operational/security invariants (destructive-route gating, zip-bomb caps, safer exports/imports, better invariant logging).

Changes:

  • Replace the old “type drift” guard with a deterministic full regeneration pipeline for generated.ts, plus generator and hygiene tests.
  • Add manual resume for Interrupted workflow runs, including atomic claim semantics and foreach resume reconciliation.
  • Add/extend reliability + security safeguards across API, DB, config persistence, export/import, and API-call pagination.

Reviewed changes

Copilot reviewed 82 out of 86 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Makefile Updates typegen to assemble/regenerate generated.ts from bindings.
frontend/src/types/tests/typegen-transform.test.ts Tests serde→TS optionalization logic against Rust fixtures.
frontend/src/types/tests/generated-hygiene.test.ts Adds hygiene invariants for regenerated generated.ts.
frontend/src/pages/WorkflowsPage.tsx Tightens typing around batch QA payload JSON items.
frontend/src/pages/Dashboard.tsx Aligns fallback mcpOverview shape with new fields.
frontend/src/pages/tests/WorkflowsPage.test.tsx Updates step mocks for new required step fields.
frontend/src/pages/tests/WorkflowsPage.qp-launch.test.tsx Updates QuickPrompt mocks with newly required fields.
frontend/src/pages/tests/DiscussionsPage.test.tsx Updates Discussion/Project mocks for expanded type shapes.
frontend/src/pages/tests/Dashboard.test.tsx Updates Discussion/Project mocks for expanded type shapes.
frontend/src/lib/i18n.ts Adds i18n strings for “resume run” UI.
frontend/src/lib/api.ts Adds workflows.resumeRun API client call.
frontend/src/lib/tests/runFilters.test.ts Updates WorkflowRun/StepResult mocks for new fields.
frontend/src/lib/tests/regression.test.ts Updates Discussion mocks for expanded type shapes.
frontend/src/lib/tests/batchTriage.test.ts Updates Discussion mocks for expanded type shapes.
frontend/src/components/workflows/WorkflowWizard.tsx Ensures new steps include step_type.
frontend/src/components/workflows/WorkflowDetail.tsx Adds resume hook + ensures batch item steps include output_format.
frontend/src/components/workflows/RunDetail.tsx Adds “Resume” button for eligible Interrupted runs.
frontend/src/components/workflows/QuickApiForm.tsx Narrows apiBody to `JsonValue
frontend/src/components/workflows/ApiCallStepCard.tsx Narrows JSON body editor onChange to `JsonValue
frontend/src/components/workflows/apiCallPlaceholders.ts Casts placeholder-substituted JSON body to JsonValue.
frontend/src/components/workflows/tests/WorkflowWizard.test.tsx Updates Project mocks for expanded type shapes.
frontend/src/components/workflows/tests/WorkflowWizard.coverage.test.tsx Updates mocks + workspace_config.require_isolation expectation.
frontend/src/components/workflows/tests/WorkflowDetail.liveStepWaitingKey.test.ts Adjusts typing workaround around optional step_type.
frontend/src/components/workflows/tests/RunDetail.test.tsx Updates run/step-result mocks for new fields.
frontend/src/components/workflows/tests/QuickPromptForm.bindings.test.tsx Updates QuickPrompt mock with required project_id.
frontend/src/components/settings/AgentsSection.tsx Refreshes Codex model tier suggestions.
frontend/src/components/tests/TestModeBanner.test.tsx Updates Discussion mocks for expanded type shapes.
frontend/src/components/tests/ProjectList.missing-path.test.tsx Updates Project mocks for expanded type shapes.
frontend/src/components/tests/ProjectCard.remap.test.tsx Updates Project mocks for expanded type shapes.
frontend/src/components/tests/ProjectCard.migration.test.tsx Updates Project mocks for expanded type shapes.
frontend/src/components/tests/ProjectCard.header-a11y.test.tsx Updates Project mocks for expanded type shapes.
frontend/src/components/tests/ProjectCard.audit-resume.test.tsx Updates Project mocks for expanded type shapes.
frontend/src/components/tests/NewDiscussionForm.test.tsx Updates Project mocks for expanded type shapes.
frontend/src/components/tests/MessageBubble.lintPill.test.tsx Updates lint-report mocks to include unverified_count.
frontend/src/components/tests/HostSyncPreview.test.tsx Updates Project mock for expanded type shapes.
frontend/src/components/tests/DiscussionSidebar.sourceBadge.test.tsx Updates Discussion mocks for expanded type shapes.
frontend/src/components/tests/DiscussionSidebar.markAllRead.test.tsx Updates mocks for new Discussion fields (currently has a syntax issue).
frontend/src/components/tests/DiscussionSidebar.grouping.test.tsx Updates Discussion/Project mocks for expanded type shapes.
frontend/src/components/tests/ChatHeader.profileEditor.test.tsx Updates Discussion mock for expanded type shapes.
frontend/src/components/tests/ChatHeader.pendingFiles.test.tsx Updates Discussion mock for expanded type shapes.
frontend/src/components/tests/ActiveAuditsPopover.test.tsx Updates Project mock for expanded type shapes.
frontend/scripts/check-types-drift.mjs Removes superseded “field drift” checker script.
frontend/scripts/assemble-generated-types.mjs Adds Rust-source scan + optionalization + whitespace normalization; now writes generated.ts.
docs/tech-debt/TD-20260713-typescript-7-native.md New tech-debt note about TS7 adoption strategy.
docs/tech-debt/TD-20260701-typegen-generated-aggregate.md Marks typegen auto-regeneration as resolved; documents new workflow.
docs/tech-debt/TD-20260630-apicall-link-header-pagination.md Marks Link-header pagination work as resolved.
docs/design/adr-001-db-connection-model.md New ADR proposal about SQLite connection model (currently in French).
CHANGELOG.md Documents new features/fixes: resume, pagination, typegen, security hardening, etc.
backend/tests/learnings_api.rs Ensures integration tests isolate config dir.
backend/tests/config_write_guard.rs Adds proof test for config write chokepoint guard.
backend/tests/api_tests.rs Isolates config dir + injects ConnectInfo; updates assertions for export version constant.
backend/src/workflows/template.rs Hardens envelope extraction; adds corpus + fuzz-lite tests + invariant logging.
backend/src/workflows/sub_workflow_step.rs Adds foreach done-set recording + 3-source resume reconciliation + tests.
backend/src/workflows/steps.rs Moves envelope-repair logging under invariant target.
backend/src/workflows/runner.rs Fixes resume detection (workspace_path implies resume); adds interrupted-resume claim/resume + tests.
backend/src/workflows/api_call_step.rs Updates pagination max_pages for new LinkHeader variant.
backend/src/workflows/api_call_executor.rs Adds LinkHeader pagination + bare-array merging + same-origin protection + tests.
backend/src/models/workflows.rs Adds PaginationSpec::LinkHeader; adds RunStatus::is_terminal.
backend/src/models/learnings.rs Exports LearningRejection model for export/import.
backend/src/models/db.rs Bumps export schema to v5 and includes new tables in DbExport.
backend/src/main.rs Routes orphan-scan warning into invariant tracing target.
backend/src/lib.rs Hardens auth gating (method-aware destructive detection, Docker-only X-Real-IP trust) + adds resume route.
backend/src/db/workflows.rs Adds atomic status-claim helper; adds state-key merge + foreach done-set helpers; tightens batch counter updates; strengthens status guards + logging.
backend/src/db/tests.rs Adds unit tests for new DB helpers and state-machine guard behavior.
backend/src/db/quick_prompts.rs Adds export/import helpers for quick-prompt version history.
backend/src/db/learnings.rs Adds export/import helpers for learning rejection counters.
backend/src/db/contacts.rs Adds invite-code auth helper enforcing accepted-only status + tests.
backend/src/core/config.rs Adds runtime guard to prevent tests clobbering real config.toml; retries for transient fd exhaustion in lock test.
backend/src/api/workflows.rs Adds POST /api/workflow-runs/:id/resume endpoint + response type.
backend/src/api/setup.rs Export/import v5 additions (QP versions + rejections), selective clears, prune, zip entry caps, and open-url test suppression + tests.
backend/src/api/mcps.rs Exports AdoptHostMcpRequest via ts-rs.
backend/src/api/mcp_remote.rs Uses RunStatus::is_terminal() as a single source of truth.
backend/src/api/learnings.rs Exports propose request/result types for ts-rs binding.
backend/src/api/federation.rs Requires accepted contacts for file fetch on F8 announce.
backend/src/api/disc_source.rs Adds lint-on-append summary + attaches report to stored message + tests.
backend/src/api/disc_invite.rs Enforces accepted-only invite-code auth for claim-by-token/fetch-file + invariant logging + tests.
backend/src/api_tests.rs Serializes + isolates tests that invoke config saves.
backend/src/agents/runner.rs Updates Codex model-tier defaults; improves Ollama truncation detection.
backend/src/agents/runner_test.rs Updates tests for Ollama truncation + new model-tier defaults.
backend/scripts/disc-introspection-mcp.py Adds MCP tool workflow_resume_run + documents LinkHeader pagination spec.
.github/workflows/ci-test.yml Switches CI typegen check to full regen + git diff guard on generated.ts.

Comment thread frontend/scripts/assemble-generated-types.mjs
Comment thread docs/design/adr-001-db-connection-model.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 82 out of 86 changed files in this pull request and generated 1 comment.

Comment thread backend/src/api_tests.rs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 82 out of 86 changed files in this pull request and generated 1 comment.

Comment thread frontend/src/components/__tests__/MessageBubble.lintPill.test.tsx
Signed-off-by: Romuald Priol <romuald.priol@protonmail.com>
@DocRoms DocRoms force-pushed the fix/run-lifecycle branch from 051d4e4 to cf3a41f Compare July 13, 2026 16:10
@DocRoms DocRoms changed the title Fix Run lifeCycle Fix : Run lifeCycle & other little things Jul 13, 2026
@DocRoms DocRoms merged commit 39a7de6 into main Jul 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-test Start all the CI Test steps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants