You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Some library failures lack a machine-readable category #3
Timing: Follow-up after trial/3 merges into main; defer implementation until then.
Review baseline: Local trial/3 at a094418baf6388e3eeca23821df481a7f0a8751c. This branch is not yet on the remote. Source locations below refer to that snapshot and should be rechecked after merge.
Problem
TransformError exposes a message and optional cause but no structured classification for its own failures. Callers cannot reliably distinguish writer contention, required recovery, ownership conflicts, selection failures, or budget exhaustion without inspecting display text. Lib and SQL already provide typed categories.
Evidence
crates/idea/idea-transformer/src/lib.rs:34-65: TransformError representation and public API.
crates/idea/idea-transformer/src/output.rs:94-120: lock-exists and recovery-required failures are textual messages.
Acceptance criteria
Provide stable machine-readable classification for transformer-owned failures without requiring message parsing.
Preserve original IO/parser/callback causes and intentional public/developer disclosure boundaries.
Check compatibility with existing constructors and callers; document any intended public API change.
Verify that callers can distinguish representative lock, recovery, budget, ownership, and underlying-source failures independently of message wording.
Code examples and suggested direction
Illustrative new API proposal, subject to compatibility review:
#[derive(Clone,Copy,Debug,Eq,PartialEq)]#[non_exhaustive]pubenumTransformErrorKind{Other,Io,Parse,LockExists,RecoveryRequired,Ownership,Selection,Limit,Callback,}// In TransformError, after adding a private kind field:pubfnkind(&self) -> TransformErrorKind{self.kind}
The category list and #[non_exhaustive] policy are suggestions, not frozen requirements. Keep detailed context and the original source chain separate from the stable category.
Deferred until trial/3 is merged into main. Recheck the merged source and tests first. The snippets are examples/proposals, not an approved patch or a change to frozen contracts.
Inventory TransformError::new, IO/parser conversions, callback wrappers, writer locking, recovery, ownership, and selection failures. Create a small classification table before editing.
Prefer an additive kind() API while keeping TransformError opaque. Audit all internal struct literals when adding a field. Retain new(message) with a deliberate fallback category for existing callers.
Assign categories at failure construction; never infer them from display text. Decide whether an outer callback/install wrapper reports its phase category while retaining the underlying typed failure in source().
Preserve parser spans, underlying IO errors, Send/Sync properties, public Display redaction, and error precedence. Document any public API decision before changing exported shapes.
A future caller should be able to do this after the proposed category API exists:
match error.kind(){TransformErrorKind::LockExists => {// Report contention; do not automatically remove the writer lock.}TransformErrorKind::RecoveryRequired => {// Direct the operator to the documented explicit recovery procedure.}
_ => returnErr(error),}
Keep tests for diagnostic wording when wording itself matters, but make recovery/classification assertions use kinds. Start with cargo test -p stackpress-idea-transformer -p stackpress-idea --locked.
Implementation workflow: After the merge, follow .agents/workflows/rust-programming.md: prove the affected behavior, complete the three test-verified review rounds, and record relevant formatting/lints/docs, feature/platform scope, and applicable development coverage. Preserve unrelated changes.
Fixed on trial/3 in 407b4d6 + df443b7 (merged as ff7a251, task 00010 lane 2; not yet on main, so leaving open).
Added an additive #[non_exhaustive]TransformErrorKind with categories for lock contention, recovery required, budget/limit, ownership, selection, parse, IO and callback failures.
Tests show callers can tell these apart without reading message text; original IO/parser/callback causes are preserved.
Coordinator-verified on the combined code: fmt, Clippy -D warnings, Rustdoc -D warnings, cargo +1.96.0 check, 466 workspace tests and 857 doctests pass (467 tests on merged trial/3). Coverage: server 91.61%, CLI 93.15%, transformer 93.62%.
Activity
cblanquera commentedon Oct 26, 2026
Suggested investigation and fix notes
Deferred until
trial/3is merged intomain. Recheck the merged source and tests first. The snippets are examples/proposals, not an approved patch or a change to frozen contracts.TransformError::new, IO/parser conversions, callback wrappers, writer locking, recovery, ownership, and selection failures. Create a small classification table before editing.kind()API while keepingTransformErroropaque. Audit all internal struct literals when adding a field. Retainnew(message)with a deliberate fallback category for existing callers.source().A future caller should be able to do this after the proposed category API exists:
Keep tests for diagnostic wording when wording itself matters, but make recovery/classification assertions use kinds. Start with
cargo test -p stackpress-idea-transformer -p stackpress-idea --locked.Implementation workflow: After the merge, follow
.agents/workflows/rust-programming.md: prove the affected behavior, complete the three test-verified review rounds, and record relevant formatting/lints/docs, feature/platform scope, and applicable development coverage. Preserve unrelated changes.cblanquera commentedon Oct 26, 2026
Fixed on
trial/3in 407b4d6 + df443b7 (merged as ff7a251, task 00010 lane 2; not yet onmain, so leaving open).#[non_exhaustive]TransformErrorKindwith categories for lock contention, recovery required, budget/limit, ownership, selection, parse, IO and callback failures.Coordinator-verified on the combined code: fmt, Clippy -D warnings, Rustdoc -D warnings,
cargo +1.96.0 check, 466 workspace tests and 857 doctests pass (467 tests on mergedtrial/3). Coverage: server 91.61%, CLI 93.15%, transformer 93.62%.Fix owner review issues #10, #3, #8, #9, #13, #12 and host parts of #4,