diff --git a/docs/roadmap/audit/discussion.md b/docs/roadmap/audit/discussion.md index 3a8bb76a..5dad33d1 100644 --- a/docs/roadmap/audit/discussion.md +++ b/docs/roadmap/audit/discussion.md @@ -315,32 +315,49 @@ CAT-025 remains outstanding until that work is implemented. ## 9. Cleanup Scope And Optional Improvements **Findings:** CAT-026 through CAT-033. -**Status:** Proposed scope; confirm before treating every entry as required work. +**Status:** Accepted scope; implementation pending, with CAT-033 deferred. - Remove the confirmed private dead helpers and obsolete policy labels - (CAT-030/CAT-031), preserving live identity bytes and behavior. No new tests of - declaration counts or absence are needed. + (CAT-030/CAT-031) after checking they remain unused, preserving live identity + bytes and behavior. No new tests of declaration counts or absence are needed. - Give the six exported `NormalizationPolicy` aliases a short intended-use check. + Remove them if they have no supported purpose; defer any whose purpose remains + unclear rather than expanding the review into a compatibility project. They reside under `internal/`; capitalization alone does not establish a supported external API. Do not turn unused internal metadata removal into a broad compatibility project, or recreate cache fingerprints to give it a use. - Remove incidental prompt-prose/run-ID assertions, use controlled scheduling in concurrency tests, and separate order-dependent example fixtures - (CAT-026–CAT-029). Preserve genuine schema, routing, ownership, worker-limit, - and maintained-example contracts. Do not replace fragile assertions with - snapshots or add tests for every private helper. -- Treat native-capture package extraction (CAT-032) as optional. Proceed only if - a small direct API improves ownership and callers; a package move alone is not - a demonstrated behavior improvement. -- Treat a KMP token matcher (CAT-033) as optional. Ordinary short entity names - make the current matcher effectively linear. Assess representative workloads - before paying additional algorithm maintenance cost; no benchmark gate or - name-length restriction is proposed. + (CAT-026–CAT-029). Include these explicitly in remediation scope. Use + test-controlled content and bounded, cancellation-safe scheduling gates. + Preserve genuine schema, routing, ownership, worker-limit, ordering, safe + allocation, uniqueness, and maintained-example contracts, including the distinct + session-ID contract. Do not replace fragile assertions with snapshots or add + tests for every private helper. +- Carry out native-capture package extraction (CAT-032) as required ownership + remediation, independent of performance benefit. A focused framework capture + package owns native request preparation hooks, result/exchange evidence, and + capture-error retention, using native PromptKit types and the existing + `EvidenceWriter`. Core operations and independently executing validators use + that same implementation. Pipeline retains operation identity and step/lane/ + chunk evidence paths; CLI/recorder retain filesystem allocation and run-level + capture lifecycle/finalization. Prefer a dedicated capture package over expanding + the storage-oriented debug package; exact naming remains an implementation + choice. Preserve cancellation, error causes, prepared-value ownership, admission + behavior, and existing evidence behavior without duplicate preparation or model + calls. No replacement execution API, telemetry service, or synchronized-writer + wrapper is included. +- Defer a KMP token matcher (CAT-033) until representative workloads demonstrate + worthwhile benefit. Ordinary short entity names make the current matcher + effectively linear. Keep existing exact token-matching semantics; no benchmark + gate or name-length restriction is selected. Deferral or declining a refactoring opportunity can be a valid outcome. Closing every catalog entry through code changes is not itself the goal. -**Decision:** Pending. +**Decision:** Cleanup, test improvements, and capture-package extraction accepted +as above; token-matching optimization deferred. Catalog implementation statuses +remain outstanding until the selected work lands; deferral is not a code fix. ## 10. Remediation Sequence And Verification @@ -359,12 +376,14 @@ Recommended approach: run/source lifetime. Preserve standalone use and current-source cache checks; no process-global cache or new cache-key dimensions are needed. 3. Add signal cancellation after Item 3, then undertake coherent ownership work - in the composition/copying, producer/reconciliation, and finalization clusters. + in the composition/copying, capture, and finalization clusters. The selected + producer/reconciliation migration is already complete. Shorten intermediate lifetimes only after their remaining consumers are clear. Keep correctness changes distinguishable from broader readability refactors. 4. Apply local sort-key improvements and useful domain sharing. Fold confirmed - dead-code and test cleanup into focused work where convenient. Reassess the - optional package and token-matcher changes last. + dead-code and explicitly scoped test cleanup into focused work where convenient. + Capture-package extraction is required under Item 9; token-matcher optimization + remains deferred. This is an ordering guide, not a serial dependency chain. Cheap independent fixes can proceed without waiting for broader discussion. Practical reachability and