Repository navigation
refactor(kernel): validate destination scope at public batch boundary - #2748
Conversation
Replace Created-as-validator coupling with directly named history identity validation. Remove destination HistoryID plumbing from private record constructors and enforce owner checks before conversion in public batch methods. Cover invalid and foreign identities, failure atomicity, and ownership-before-payload precedence through public methods. Follow-up to #2746; refs #2663. API compatibility: no public Go signatures, wire behavior, persistence formats, or production integration changes. Co-authored-by: Mecatl <[email protected]>
|
Published: 2026-11-08T02:42:23Z Kernel validation cleanup — follow-up to #2746Slug: kernel-validation-cleanup Scope and decisionsDeliver the approved round-4 review cleanup that remained uncommitted when #2746 merged. The original baseline and merged main have identical tracked trees; the exact reviewed cleanup diff is unchanged on the follow-up branch. This is not the reusable view/boilerplate investigation in #2747.
Tasks and acceptance
VerificationRequired scoped checks:
All passed on the final implementation candidate before delivery. A final test-adequacy advisory was resolved with the oversized-payload matrix; original malformed coverage was retained, integrated checks rerun, and targeted incremental review passed. Final panel: no open blockers, important or advisory findings; no unresolved reviewer failures. Public API/schema/generated files and tracked Markdown are unchanged, so no regeneration/docs gate is required. Isolated-engine exemption applies: no full repository suite, production demo, live-provider tests or module pin changes. Compatibility and boundariesAPI compatibility: no wire/protobuf/server/client changes, major/feature changes or production integration. Public Go signatures, persistence schema/version and canonical bytes are unchanged. Only private constructor signatures and validation placement change; the explicit error precedence above is within the isolated experimental kernel. No stored-data migration or upgrade action. Defer #2747 investigation/approach selection, extension registry, lifecycle redesign, passive tool disposition, request reconstruction, final accounting and production wiring. No approach for reusable views/generation/dependencies is selected here. Joe authorized the follow-up PR after discovering this cleanup was not pushed with #2746. Commit/push/PR publication are authorized; merge remains human-only. The earlier checkout reset stays paused while this PR is open. |
Summary
Approved cleanup plan and verification record
Follow-up to #2746 for the final review cleanup that was implemented locally but not included in that merge. Refs #2663; separate from the next boilerplate investigation in #2747.
Createdsolely to validate a history ID with direct private history-ID validation.SessionCommitmethods, before scope-erasing DTO conversion.HistoryIDarguments from all 11 private record constructors and adapt callers/reservations.The branch starts at merged
main(8c1276a7da77eca4ce31f3e7c44023464aeb0994). Its base tree is identical to the original review baseline, and the cleanup patch is byte-identical to the reviewed and tested candidate.Verification
Passed on the exact final implementation candidate:
cd engine && go test -race ./id ./kernel/... ./arch ./adapter/history/...cd engine && GOWORK=off go test ./kernel/... ./arch ./adapter/history/...cd engine && GOARCH=386 go test ./kernel/...task lint,task api:check,task generate:codecs:check,git diff --checkIsolated-engine scope; no full repository suite, production demo or live-provider tests. No tracked Markdown, generated files or public API snapshot changes.
API compatibility
No wire/protobuf/server/client changes, feature/major changes or production integration. Public Go signatures, persistence schema/version and canonical bytes are unchanged. Private constructor signatures change. Public additions validate top-level identity, then owner, then bounded payload; input/request retain exact-active-run-first behavior. Valid foreign identity returns
ErrIdentitybefore contradictory malformed/oversized payload errors. No stored-data migration or upgrade action.Scope
Public replacement
HistoryIDfields remain unchanged. Reusable view/generator tooling and dependency choices remain #2747's investigation; this PR does not select or implement that approach.