Repository navigation
feat(dtogen): generate MutableClone for DTO-backed views - #2795
Conversation
Generate MutableClone for views backed by an explicitly declared Clone owner, retaining zero, payload ownership, and enclosing-scope boundaries. Roll out existing views and replace the legacy RecordView.Format export with MutableClone. Co-authored-by: Mecatl <noreply@mecatl.dev>
Approved implementation plan
Generated DTO view mutable clonesScope and contractImplement concrete
Generation policyGenerate Supply the same explicit owner metadata to load-only bootstrap and final generation. Preserve per-module Approved amendment: replace DTO export
|
Summary
MutableClone()methods for DTO-backed views whose explicitly declared DTO owner selectsclone; delegate detachment to the existing DTOClone()method.RecordView.Format()withMutableClone()and migrate callers; keep schema-labelFormat()accessors.This supplies a prerequisite for #2793. It does not implement or close that PR's instruction-contract follow-ups, import its modelrequest/UserContextPrefix types, rename instructions, change contribution slots/provenance, or add the resume example or production integration.
Verification
task testtask linttask test:racetask docstask generate:data:checktask api:checkgo run ./cmd/mecademo(tool call, permission ask/approval, and final result)Independent Spec, Standards, Test adequacy, Architecture, Library reuse, and Duplication reviews completed. The test reviewer found two important assertion gaps; both were fixed and independently rechecked. No open findings.
API compatibility
No wire or stored-data changes; no wire major/feature identifier changes or upgrade sequencing required. Generated methods are additive Go APIs. Removing
RecordView.Format()is an explicitly operator-approved Go source break within the isolated kernel experiment: callers useMutableClone()instead.RecordViewretains its handwritten materialized-record implementation; DTO-backed views use generated methods. No production entry points change.Implementation plan
Approved plan, including the Format-export amendment.