Plan immutable domain value types with Valibot schemas (1.3.1)#14
Draft
lodyai[bot] wants to merge 1 commit into
Draft
Plan immutable domain value types with Valibot schemas (1.3.1)#14lodyai[bot] wants to merge 1 commit into
lodyai[bot] wants to merge 1 commit into
Conversation
Add the ExecPlan for roadmap item 1.3.1, which defines and validates the core domain value types (RunState, Resources, TechDebtVector, AllocationPolicy, EthicsPolicy, AlignmentState, ProgressionState, UnlockLedger) as immutable, schema-first Valibot types under src/domain/model/. The plan is schema-first (types derived via v.InferOutput), enforces the AllocationPolicy sum-to-100 rule with integer percentage points, and proves deep immutability with a compile-time DeepReadonly assertion. It was drafted with research on Valibot 1.x and fast-check v4 idioms and revised after a community-of-experts design review. Status: DRAFT — awaiting approval before implementation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the ExecPlan for roadmap item 1.3.1 — "Define and validate the core domain value types". It contains no production code; it is the approval draft of the plan that will guide implementation.
The plan is in
docs/execplans/1-3-1-immutable-types-with-valibot-schemas.mdand proposes implementingRunState,Resources,TechDebtVector,AllocationPolicy,EthicsPolicy,AlignmentState,ProgressionState, andUnlockLedgeras immutable, schema-first TypeScript value types undersrc/domain/model/, validated with Valibot v1.2 and property-tested with fast-check v4.Key design decisions
v.InferOutput, so type/schema drift is structurally impossible.v.check, making the equality check numerically exact (no float-summation pitfall). The schema is the single enforcement point; the 2.1.2 validation service will delegate to it.v.readonly(), with a compile-timeDeepReadonly<RunState>assertion that failstscif any reachable field is writable.RunId,Seed,Percent,Decimalish, …) viav.brand;Seedis constrained to the 32-bit unsigned range per ADR 005;Decimalishand unbounded numbers carryv.finite().RunState's not-yet-owned references (QualityCoverageVector,MacroState,GameEvent,EventResolution,EndingState) are isolated in an un-exportedplaceholders.tswith a deletion/migration contract, so later items can reshape them without external coupling.Scope notes
css-viewrequirements are satisfied vacuously;bun ffmust still pass green. The plan records this explicitly.corbusier-design-language.md,daisyui-v5-guide.md,tailwind-v4-guide.md, etc.) are not present in the repository; they concern later UI slices and are recorded under Surprises.Process
The plan was drafted with assistance from a research/planning agent team (repo-convention extraction and Valibot 1.x / fast-check v4 idiom research via Firecrawl), then reviewed and revised by a Logisphere community-of-experts panel (contracts, structure, failure modes, and alternatives). The revision note at the foot of the document lists the changes the review produced.
Reviewer focus
RunStatenow with isolated placeholder sub-schemas (vs deferringRunState). The roadmap listsRunStateas in-scope.AlignmentState,ProgressionState, andUnlockLedger, which the HLD names but does not sketch.References
docs/execplans/1-3-1-immutable-types-with-valibot-schemas.mddocs/roadmap.md🤖 Generated with Claude Code