Skip to content

feat(legal): add fail-closed due diligence coverage - #445

Closed
zhengdaqi wants to merge 30 commits into
codex/legal-runtime-e2efrom
codex/legal-coverage-v1
Closed

feat(legal): add fail-closed due diligence coverage#445
zhengdaqi wants to merge 30 commits into
codex/legal-runtime-e2efrom
codex/legal-coverage-v1

Conversation

@zhengdaqi

Copy link
Copy Markdown
Collaborator

Summary

This stacked PR adds a legal due-diligence Domain Plugin and Skill on top of the generic Agent Harness introduced by #437. It uses hook-driven dynamic context and state-based milestones to guide legal work, then blocks completion until deterministic source, fact, issue, authority, coverage, and deliverable checks pass.

The implementation remains entirely inside products/legal plus focused tests. It does not add case-specific logic or change PilotDeck Core.

Changes

  • Add the legal-coverage plugin with legal-only activation, dynamic prompt injection, model-request state metadata, and fail-closed Stop handling.
  • Add the conduct-legal-due-diligence Skill and explicit canonical data contracts for sources, facts, matrices, issues, authorities, and final coverage.
  • Add validator v1.2.0 guards for top-level document types, reviewed-source SHA-256 binding, current source/deliverable proof hashes, workspace path constraints, unresolved verification states, semantic issue/authority quotes, and reciprocal same-entry relationships.
  • Reuse the same real-path constraint for Hook config, proof, and session read/write/remove operations.
  • Add adversarial product tests and real createLocalGateway tests for dynamic milestones, bounded correction, Stop-time I/O failure, malformed-config recovery, and unsafe session paths.

QA & Evidence

  • Focused legal and real-gateway suites: 22/22 passed. Artifact: .omo/evidence/20260723-legal-coverage-v1/post-review-fix-gates.txt.
  • Full repository suite: 214/214 passed after a clean production build. Artifact: .omo/evidence/20260723-legal-coverage-v1/post-review-fix-gates.txt.
  • Real difficult case: validator v1.2.0 passed with 0 errors and 0 warnings over 62 sources, 76 facts, 14 issues, 25 authorities, and one deliverable. Artifact: .omo/evidence/20260723-legal-coverage-v1/hard-case-validator-summary.txt.
  • Independent difficult-case verifier: passed inventory, machine-readable inspection, presentation, topic, reverse-coverage, and integrity checks. Artifact: .omo/evidence/20260723-legal-coverage-v1/hard-verifier-summary.txt.
  • Known shortcut fixture: rejected with 1,359 errors and no remaining completion proof. Artifact: .omo/evidence/20260723-legal-coverage-v1/false-positive-rejection-summary.txt.
  • Real Agent recovery: 49/49 migration requests and 15/15 integrity requests received dynamic patches; the Stop gate continued until both validation surfaces passed. Artifact: .omo/evidence/20260723-legal-coverage-v1/recovery-v12-summary.txt.
  • Independent final review: no findings; all seven review findings closed. Artifacts: .omo/evidence/20260723-legal-coverage-v1/final-code-review-v3.txt and .omo/evidence/20260723-legal-coverage-v1/final-manual-qa-v3.txt.

Risks & Residuals

  • External Judge gate is not complete. The scoring endpoint currently resolves to a private network with no route from this machine, so no current overall or critical score exists. This PR remains draft until the required overall >=90%, critical >=95%, and zero Judge errors are observed. Evidence: .omo/evidence/20260723-legal-coverage-v1/judge-connectivity.txt.
  • Semantic quote support is a deterministic lexical guard, not a substitute for substantive legal review.
  • Binary deliverables rely on explicit locators and claims because exact text validation is unavailable.
  • A generic empty-shell-redirection risk observed under bypass permissions belongs to PilotDeck Core and is intentionally excluded from this legal-only PR.
  • One topic-evidence compatibility artifact and the reverse-coverage compatibility artifact were originally QA-derived from validated canonical ledgers; the evidence reports preserve this provenance qualification.

Stack

mssssss123 and others added 30 commits July 23, 2026 12:04
…olution and improved error handling

- Introduced functions to resolve the appropriate bash executable based on the environment, improving compatibility across platforms.
- Updated the update application logic to utilize the resolved bash executable for executing update scripts.
- Enhanced error handling to provide more informative messages when the update process fails, particularly regarding bash executable issues.
- Added new service functions for managing update runtime errors and restart commands.
- Implemented unit tests to verify the new functionality and ensure robust error handling.
…adjustments

- Added new styles for the settings content header to improve typography.
- Updated various components to refine spacing and alignment for a more cohesive layout.
- Adjusted font sizes and line heights across settings sections for better readability.
- Enhanced sidebar navigation with consistent padding and hover effects for improved user experience.
- Modified general settings section to streamline visual hierarchy and spacing.
…ation

- Renamed settings components for clarity and consistency.
- Introduced new settings navigation logic to enhance user experience.
- Added unit tests for the new navigation functionality.
- Removed deprecated constants and hooks to streamline the codebase.
- Updated styles for improved layout and readability across settings sections.
feat: introduce redesigned settings center and harden cross-platform updates
…w functionality

- Added `getPdfNavigationMode` utility to determine navigation type based on file extension.
- Introduced `PdfOutline` and `resolvePdfOutline` for handling PDF outlines and navigation.
- Enhanced `PdfDocumentPreview` component with navigation controls and improved rendering logic.
- Updated `CodeEditorBinaryFile` to support PDF navigation and expand/collapse functionality.
- Added unit tests for new PDF navigation features and outline resolution.
- Improved UI elements for better user experience in document previews.
- Added `findPdfSearchMatches` and `renderPdfSearchHighlights` functions for searching and highlighting text in PDF documents.
- Created unit tests for the search functions to ensure accurate match detection and rendering.
- Updated `PdfDocumentPreview` component to integrate search functionality, allowing for text highlighting and selection.
- Enhanced text handling in the PDF viewer to support search results and improve user interaction.
…tion

- Added `handleTabsClose` method to manage closing multiple tabs atomically and selecting the nearest remaining tab.
- Enhanced `EditorSidebar` and `CodeEditorTabBar` components to support closing all tabs with context menu options.
- Updated UI to include confirmation prompts for unsaved changes when closing tabs.
- Added unit tests to verify the new tab closing behavior and ensure proper state management.
- Localized new tab actions in English and Chinese for improved user experience.
…ed input handling

- Updated `ChatHistorySearchBar` to manage input state with draft queries and handle IME composition events.
- Implemented composition start and end handlers to preserve input during Chinese IME usage.
- Refactored keydown event handling to improve search navigation and escape functionality.
- Added unit tests for preserving IME composition in `MainAreaV2` to ensure correct behavior during search interactions.
- Updated search highlight styles for improved visibility and user experience.
- Refactored `highlightSearchMatches` to support multiple highlighted occurrences and distinguish the active match.
- Enhanced unit tests to verify correct highlighting behavior in chat history and PDF search components.
- Introduced new CSS variables for consistent highlight styling across different themes.
feat(ui): enhance document previews, tab controls, and search
@zhengdaqi

Copy link
Copy Markdown
Collaborator Author

Superseded by clean stacked PR #447. PR #445 had a criss-cross merge-base with #437 after both branches merged main independently, which inflated the diff to 190 files. #447 is based directly on the updated #437 head and has a 39-file legal-only diff. This PR is retained only as historical context and rollback reference.

@zhengdaqi zhengdaqi closed this Jul 24, 2026
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.

2 participants