world-view-contract-guard-meta-test-retirement#788
Conversation
…rkDispatch JSON behavior before guard retirement Co-authored-by: Cursor <cursoragent@cursor.com>
…rld-view projection output before guard retirement Co-authored-by: Cursor <cursoragent@cursor.com>
…undant reflection guard coverage Co-authored-by: Cursor <cursoragent@cursor.com>
…used backend test evidence Co-authored-by: Cursor <cursoragent@cursor.com>
Mergeability follow-up (story 004)CI
Local verification: |
…used backend test evidence Co-authored-by: Cursor <cursoragent@cursor.com>
Additional mergeability follow-up
Extracted |
…used backend test evidence Co-authored-by: Cursor <cursoragent@cursor.com>
Additional mergeability follow-up
Consolidated both into |
{
"project": "infinite-you",
"branchName": "ralph/world-view-contract-guard-meta-test-retirement",
"description": "Retire redundant reflection inventory coverage from the world-view contract guard while preserving observable WorkDispatch JSON behavior and BuildFactoryWorldView projection behavior from canonical events.",
"context": {
"customerAsk": "Remove pkg/interfaces/world_view_contract_guard_test.go or reduce it to only behavior that is not already covered elsewhere. Delete reflection inventory tests for approved field lists and absent fields, confirm pkg/interfaces/work_runtime_test.go still covers WorkDispatch public JSON behavior, confirm pkg/factory/projections/projectiontests/world_view_support_test.go covers world-view shape through BuildFactoryWorldView output from canonical events, and add only small behavioral assertions if a real customer-visible gap remains. Do not touch current dirty factory-graph save/layout files, preserve public runtime/API behavior, keep the change narrow, and prefer observable JSON/projection behavior over source layout or struct field inventory assertions.",
"problem": "The backend still has a meta-test surface that freezes WorkDispatch, FactoryWorldTopologyView, and FactoryWorldRuntimeView structure through reflection and approved field inventories. This duplicates behavior-focused runtime and projection tests, increasing maintenance cost without improving confidence in observable API, CLI, UI, or emitted-event behavior.",
"solution": "Use existing runtime and projection tests as the contract authority. Remove or reduce the redundant reflection guard, add only narrowly scoped behavioral JSON/projection assertions if a genuine gap is found, and verify with go test ./pkg/interfaces plus go test ./pkg/factory/projections/...."
},
"acceptanceCriteria": [
"WorkDispatch public JSON behavior remains covered by behavior-focused tests, including dispatch-owned values, omission of worker-owned fields, and clone behavior.",
"BuildFactoryWorldView projection behavior remains covered from canonical events, including the topology/runtime output shape consumed by downstream surfaces.",
"Redundant reflection field-inventory assertions for WorkDispatch, FactoryWorldTopologyView, and FactoryWorldRuntimeView are removed or reduced to only non-duplicated behavioral coverage.",
"No public runtime, API, CLI, UI, OpenAPI, or emitted-event behavior changes unless an existing redundant legacy shim is proven safe by behavioral tests.",
"The change does not touch dirty factory-graph save/layout work or unrelated frontend files.",
"Any added coverage asserts observable JSON/projection outcomes, not source layout, route inventories, struct field inventories, docs topology, or asset-bundle internals.",
"Quality gate: Go typecheck, lint for touched files, go test ./pkg/interfaces, and go test ./pkg/factory/projections/... pass."
],
"userStories": [
{
"id": "world-view-contract-guard-meta-test-retirement-001",
"title": "Confirm WorkDispatch JSON behavior before guard retirement",
"description": "As a backend maintainer, I want WorkDispatch behavior protected by runtime JSON tests so removing reflection inventories does not weaken the public dispatch contract.",
"acceptanceCriteria": [
"Existing or minimally adjusted pkg/interfaces/work_runtime_test.go coverage verifies that marshalled WorkDispatch output includes the dispatch-owned values expected by runtime consumers.",
"Existing or minimally adjusted pkg/interfaces/work_runtime_test.go coverage verifies that worker-owned fields remain omitted from public WorkDispatch JSON output.",
"Existing or minimally adjusted pkg/interfaces/work_runtime_test.go coverage verifies WorkDispatch clone behavior for mutable content that would otherwise leak state.",
"No new WorkDispatch coverage is implemented as an approved struct-field list or absent-field reflection inventory.",
"Typecheck passes",
"Tests pass"
],
"priority": 1,
"passes": true,
"notes": ""
},
{
"id": "world-view-contract-guard-meta-test-retirement-002",
"title": "Confirm world-view projection output before guard retirement",
"description": "As a backend maintainer, I want world-view contract confidence to come from BuildFactoryWorldView projection output so downstream surfaces are protected by event-to-view behavior.",
"acceptanceCriteria": [
"Existing or minimally adjusted projection tests build a factory world view from canonical events and verify the resulting topology data needed by downstream consumers.",
"Existing or minimally adjusted projection tests build a factory world view from canonical events and verify the resulting runtime data needed by downstream consumers.",
"If a missing customer-visible world-view case is found, the added assertion checks BuildFactoryWorldView output for a concrete event scenario rather than reflecting over Go struct fields.",
"No projection coverage is added as a source-layout, route-registration, or struct-field inventory assertion.",
"Typecheck passes",
"Tests pass"
],
"priority": 2,
"passes": true,
"notes": ""
},
{
"id": "world-view-contract-guard-meta-test-retirement-003",
"title": "Retire redundant reflection guard coverage",
"description": "As a backend maintainer, I want the redundant world-view reflection guard removed so the test suite enforces observable contracts instead of freezing implementation shape.",
"acceptanceCriteria": [
"Redundant reflection inventory checks for approved field lists on WorkDispatch, FactoryWorldTopologyView, and FactoryWorldRuntimeView are removed from pkg/interfaces/world_view_contract_guard_test.go.",
"Redundant absent-field reflection checks are removed when the same public behavior is covered by runtime JSON or projection-output tests.",
"If the guard file has no remaining unique behavioral assertion after cleanup, it is deleted rather than kept as an empty shell.",
"Public runtime/API behavior remains unchanged; implementation does not introduce broad interface refactors or OpenAPI changes for this cleanup.",
"Typecheck passes",
"Tests pass"
],
"priority": 3,
"passes": true,
"notes": ""
},
{
"id": "world-view-contract-guard-meta-test-retirement-004",
"title": "Verify focused backend test evidence",
"description": "As a reviewer, I want focused package test results proving the guard retirement preserved runtime and projection behavior.",
"acceptanceCriteria": [
"go test ./pkg/interfaces passes after the guard retirement.",
"go test ./pkg/factory/projections/... passes after the guard retirement.",
"Any test changed or added in this cleanup has at least one assertion about observable JSON or projection output.",
"No dirty factory-graph save/layout files are modified by the implementation.",
"Typecheck passes",
"Tests pass"
],
"priority": 4,
"passes": true,
"notes": ""
}
]
}
Made with Cursor