Objective
Implement the unified request-owned business TraceChain contract, distinct from the existing physical tracePath, across TeaQL runtimes and generator scopes.
Contract
- Each real query request owns a nonblank local comment. Application roots require caller comment and purpose.
- Framework-derived requests may resolve default comments from actual operation/model metadata. Explicit child comments survive.
- Preserve the language-native Q-operation parent and the nested query comment as separate nodes. Retain count/facet caller aliases.
- Immutable parent ownership; root-resolved purpose; concurrent reusable child templates remain isolated.
- Business traceChain and physical tracePath remain separate. Safe log projections preserve structure while masking sensitive intent.
- No what:/why: prefix parsing/rejection. Mutation entities may inherit parent reasons; do not strengthen this into handwritten comments per entity.
- Generated workspaces delegate to the formal runtime instead of duplicating request/trace semantics.
SQLite acceptance
Use a bounded customer-order model/query covering dynamic search, countAs(totalOrders), facetByStatusAs(statusCounts), status count and sum(totalAmount), status selection, ordered item previews limited to 3, complete itemCount, date/id descending order, purpose/comment and page execution.
Observe actual SQLite statements and runtime-created chains; assert data, counts, facet sums, per-parent child limits, explicit/default comments, alias escaping, snapshot isolation, logging off, intent validation and masking. A single SQL with multiple aggregate expressions remains one physical evidence record.
Retain exact commands, source revisions and red/green results. Keep all examples local-source; regenerate derived libraries rather than patching them.
Non-goals and compatibility
No multi-database qualification, public release, release-tag change or public generator deployment in this implementation task. SQLite is the requested provider boundary. Generated-library migration may require regeneration; keep native business query spelling where practical.
Coordination
Primary issue: teaql/teaql-rs#246
This issue owns the teaql-python changes and their acceptance evidence. Design source: teaql-conformance/design/polyglot-request-trace-chain.md (2026-10-11 request-comment clarification).
Objective
Implement the unified request-owned business TraceChain contract, distinct from the existing physical tracePath, across TeaQL runtimes and generator scopes.
Contract
SQLite acceptance
Use a bounded customer-order model/query covering dynamic search, countAs(totalOrders), facetByStatusAs(statusCounts), status count and sum(totalAmount), status selection, ordered item previews limited to 3, complete itemCount, date/id descending order, purpose/comment and page execution.
Observe actual SQLite statements and runtime-created chains; assert data, counts, facet sums, per-parent child limits, explicit/default comments, alias escaping, snapshot isolation, logging off, intent validation and masking. A single SQL with multiple aggregate expressions remains one physical evidence record.
Retain exact commands, source revisions and red/green results. Keep all examples local-source; regenerate derived libraries rather than patching them.
Non-goals and compatibility
No multi-database qualification, public release, release-tag change or public generator deployment in this implementation task. SQLite is the requested provider boundary. Generated-library migration may require regeneration; keep native business query spelling where practical.
Coordination
Primary issue: teaql/teaql-rs#246
This issue owns the teaql-python changes and their acceptance evidence. Design source: teaql-conformance/design/polyglot-request-trace-chain.md (2026-10-11 request-comment clarification).