## Summary This PR implements Spec 206 end to end and establishes the first checked-in test suite governance foundation for the platform app. Key changes: - add manifest-backed test lanes for fast-feedback, confidence, browser, heavy-governance, profiling, and junit - add budget and report helpers plus app-local artifact generation under `apps/platform/storage/logs/test-lanes` - add repo-root Sail-friendly lane/report wrappers - switch the default contributor test path to the fast-feedback lane - introduce explicit fixture profiles and cheaper defaults for shared tenant/provider test setup - add minimal/heavy factory states for tenant and provider connection setup - migrate the first high-usage and provider-sensitive tests to explicit fixture profiles - document budgets, taxonomy rules, DB reset guidance, and the full Spec 206 plan/contracts/tasks set ## Validation Executed during implementation: - focused Spec 206 guard/support/factory validation pack: 31 passed - provider-sensitive regression pack: 29 passed - first high-usage caller migration pack: 120 passed - lane routing and wrapper validation succeeded - pint completed successfully Measured lane baselines captured in docs: - fast-feedback: 176.74s - confidence: 394.38s - heavy-governance: 83.66s - browser: 128.87s - junit: 380.14s - profiling: 2701.51s - full-suite baseline anchor: 2624.60s ## Notes - Livewire v4 / Filament v5 runtime behavior is unchanged by this PR. - No new runtime routes, product UI flows, or database migrations are introduced. - Panel provider registration remains unchanged in `bootstrap/providers.php`. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #239
10 KiB
Data Model: Test Suite Governance & Performance Foundation
This feature does not introduce new runtime database tables. The data-model work formalizes repository-level governance objects that define how tests are grouped, how heavy setup is declared, and how runtime drift is reported. The first slice uses four operational lanes (fast-feedback, confidence, browser, and heavy-governance) plus two support-lane entries (profiling and junit) that share the same manifest and reporting contract shape while keeping narrower responsibilities. Field names in this document are conceptual and may appear in camelCase form in the checked-in manifest and logical reporting contracts. In particular, lane_id maps to manifest id and report laneId, artifact_modes maps to manifest artifacts, accepted-run artifactModes, and report artifacts[].artifactMode, and enforcement_level maps to manifest-contract enforcement.
1. Test Lane
Purpose
Represents one checked-in execution path or support-lane entry for the suite.
Fields
lane_id: stable identifier such asfast-feedback,confidence,heavy-governance,browser,profiling, orjunitgovernance_class:fast,confidence,heavy, orsupportdescription: contributor-facing statement of the lane's purposeintended_audience: the contributor or reviewer audience the lane is optimized forincluded_families: written list of the families the lane intentionally ownsexcluded_families: written list of the families the lane intentionally leaves outownership_expectations: contributor-facing statement of when the lane is expected to be run and maintaineddefault_entry_point: booleanparallel_mode:required,optional, orforbiddenselectors: include and exclude rules for suites, directories, files, and groupsartifact_modes: list of expected outputs such assummary,junit-xml,profile-top, orbudget-reportbudget: runtime target and enforcement leveldb_strategy: expected connection and reset discipline
Validation rules
- Exactly one lane may be the default contributor entry point.
- The first-slice manifest must include the four operational lanes and the two support runs.
- Support runs remain lane-shaped manifest entries with
governance_class = supportand the same reporting envelope as operational lanes. - A lane that emits
profile-topmust useparallel_mode = forbidden. - A lane with
lane_id = browsermust not be the default contributor lane. - A lane must have at least one positive selector.
- Every lane declaration must record its purpose or description, intended audience, included families, excluded families, and ownership expectations.
- The
fast-feedbacklane budget must carrybaseline_delta_target_percent = 50for the first slice.
2. Lane Selector
Purpose
Represents one inclusion or exclusion rule that determines lane membership.
In the first-slice manifest contract, selector records are serialized into the flattened include or exclude arrays on each lane entry. The richer selector fields below remain conceptual metadata for planning, review, and future helper logic rather than required manifest fields.
Fields
selector_type:testsuite,path,group, orfileselector_value: exact suite name, directory path, group name, or file pathinclusion_mode:includeorexcluderationale: short explanation of why the selector belongs to the lanecost_class: optionalnormal,heavy, orspecial-case
Relationships
- Many selectors belong to one test lane.
- Selectors may be shared conceptually across lanes but are evaluated per lane declaration.
3. Test Classification Rule
Purpose
Defines what makes a test legitimately belong to a particular classification.
Fields
classification:unit,feature-integration,browser, orarchitecture-governancelaravel_boot_allowed: booleandatabase_allowed: booleanbrowser_runtime_required: booleanlivewire_or_filament_mount_allowed: booleandefault_lane_target: lane identifierpromotion_conditions: list of conditions that force escalation into a heavier lane
Validation rules
unitclassification must not require browser runtime.browserclassification must require browser runtime.- Tests that need broad file scans, whole-surface discovery, or smoke assertions across many pages must not default into the fast-feedback lane.
4. Shared Fixture Profile
Purpose
Represents a named setup profile for a shared test helper.
Fields
helper_name: examplecreateUserWithTenantprofile_name:minimal,full, or another explicit cost-bearing namedefault_profile: booleancreates_workspace: booleancreates_membership: booleancreates_credentials: booleancreates_provider_connection: booleansets_session_context: booleancreates_ui_context: booleanclears_capability_caches: booleannotes: contributor guidance on when this profile is appropriate
Validation rules
- Each shared helper must have exactly one default profile.
- A default profile should not create workspace, membership, credentials, provider connection state, session context, cache-clearing side effects, or UI context unless the helper's primary job is specifically to set up that heavier behavior.
- Profiles with materially heavier behavior must use explicit names rather than boolean flags only.
5. Factory Cost Profile
Purpose
Describes the cost posture of a factory state used in tests.
Fields
factory_namestate_namecost_class:minimal,standard, orheavycreates_relationships: list of related models or graph expansionsintended_usage: short explanation of the state's purposesafe_default: boolean
Validation rules
- A heavy state must document which additional relationships it creates.
- Factories used in high-volume tests should expose at least one minimal or standard state that avoids surprising graph expansion.
6. Database Reset Policy
Purpose
Formalizes the allowed DB behavior for a suite or lane.
Fields
target_scope:unit,feature,browser,pgsql, orlane-specificconnection_mode:sqlite-memory,pgsql, ormixedreset_strategy:none,refresh-database, ordedicated-suiteseeds_policy:forbidden,restricted, orallowed-by-exceptionschema_baseline_candidate: booleannotes
Validation rules
- A policy using
connection_mode = sqlite-memoryshould treat schema-baseline work as optional evidence rather than assumed default value. - A policy using
reset_strategy = dedicated-suitemust name the target suite or command path that justifies the exception.
7. Runtime Budget
Purpose
Represents the expected wall-clock target for a lane or known heavy family.
Fields
budget_idtarget_type:laneorfamilytarget_id: lane identifier or family identifierthreshold_secondsbaseline_source:measured-current-suiteormeasured-laneenforcement_level:report-only,warn, orhard-failbaseline_delta_target_percent: optional percentage reduction target versus the current full-suite baseline when applicable, such as the fast-feedback 50% targetlifecycle_state:draft,measured,documented, orenforcedreview_cadence: short rule such astighten after two stable runs
State transitions
draft→measuredmeasured→documenteddocumented→enforced
8. Lane Report Artifact
Purpose
Represents one machine-readable or human-readable artifact emitted by a lane.
Fields
artifact_type:summary,junit-xml,profile-top, orbudget-reportrelative_path: app-root relative path understorage/logs/test-lanesmachine_readable: booleangenerated_by_lanes: list of lane identifiersretention_scope:local-ephemeral
Validation rules
- Artifact paths must be relative to
apps/platformbecausescripts/platform-sailchanges into the app directory. - Machine-readable budget evaluation must include the measured duration, threshold, and status.
- First-slice artifact retention is local-only under
storage/logs/test-lanes; CI upload is later hardening work, not part of this contract.
8a. Family Budget Threshold
Purpose
Represents the budget contract for a heavy file, group, path, or suite family that is tracked alongside lane-level budgets.
Fields
family_id: stable identifier for the heavy familyselector_type:testsuite,path,group, orfileselectors: one or more selectors that identify the tracked familythreshold_seconds: allowed wall-clock target for the family clusterbaseline_source:measured-current-suiteormeasured-laneenforcement_level:report-only,warn, orhard-failnoteslifecycle_state:draft,measured,documented, orenforced
Validation rules
- Every first-slice manifest must carry at least one family budget threshold in addition to lane-level budgets.
- Family budget thresholds must use the same baseline-backed source vocabulary as lane budgets.
9. First-Slice Governance Inventory
Current suite footprint
- Approximate test file count:
1,122 - Feature files:
873 - Unit files:
234 - Browser files:
12 - Architecture files:
2 - Deprecation files:
1
Current hotspots
createUserWithTenant()is referenced by roughly607test files and currently provisions user, tenant, workspace, workspace membership, session context, capability cache clears, and provider connection state by default.tests/Pest.phpappliesRefreshDatabasebroadly totests/Featureandtests/Browser.- Existing explicit Pest groups are sparse, with
ops-uxas the largest visible group seam.
First-slice target objects
fast-feedbacklane definitionconfidencelane definitionheavy-governancelane definitionbrowserexecution targetprofilingandjunitsupport targetscreateUserWithTenantminimal and full fixture profiles- At least one additional factory or fixture cluster with explicit minimal and heavy cost profiles