refactor(core): normalize core vocabulary#15
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the project’s domain vocabulary to a GitHub-Actions-style model end-to-end: Assessment (saved definition) → Run (execution) → Scenario (YAML unit) → Expectation (YAML check), including API paths, frontend routes, types, stores, and DB migrations.
Changes:
- Renames saved “scenarios” to assessments across API/client/frontend and adds assessment-by-name retrieval.
- Renames run linkage and result vocabulary (
scenario_id→assessment_id,assertions→expectations) and introducesscenario_results.erroredto distinguish execution errors from expectation mismatches. - Updates UI navigation and labels to separate Runs (history/executions) from Assessments (definitions), plus retention key renames to
run_*.
Reviewed changes
Copilot reviewed 92 out of 93 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| web/frontend/src/routes/secrets/+page.svelte | Dialog sizing class normalization |
| web/frontend/src/routes/runs/[id]/+page.svelte | Run detail page vocabulary + routing updates |
| web/frontend/src/routes/rules/coverage/+page.svelte | Coverage page links updated to new routes |
| web/frontend/src/routes/assessments/new/+page.svelte | Create assessment flow wired to new API/routes |
| web/frontend/src/routes/assessments/[id]/edit/+page.svelte | Edit assessment page wired to new API/routes/types |
| web/frontend/src/routes/assessments/[id]/+page.svelte | Assessment detail page uses new API/run routing |
| web/frontend/src/routes/+page.svelte | Dashboard swaps “recent scenarios” → “recent assessments” and loads new store |
| web/frontend/src/lib/types/index.ts | Frontend types renamed/reshaped (assessment, expectations, run fields) |
| web/frontend/src/lib/stores/scenarios.ts | Removes old scenarios store |
| web/frontend/src/lib/stores/runs.ts | Updates comments/semantics for runs list store usage |
| web/frontend/src/lib/stores/assessments.ts | Adds assessments list store + paging loader |
| web/frontend/src/lib/components/SimulationDetailSheet.svelte | Removes component (superseded) |
| web/frontend/src/lib/components/Sidebar.svelte | Nav relabeling/repointing (Runs/Assessments) |
| web/frontend/src/lib/components/SectionCards.svelte | Dashboard card labels/props updated for new vocabulary |
| web/frontend/src/lib/components/ScheduleDialog.svelte | Scheduling UI updated to assessment vocabulary + responsive sizing |
| web/frontend/src/lib/components/ScenarioResult.svelte | UI switches assertions → expectations rendering |
| web/frontend/src/lib/components/ScenarioEditor.svelte | Editor calls lintAssessment and updates copy to “Assessment” |
| web/frontend/src/lib/components/RunCard.svelte | Removes component (superseded) |
| web/frontend/src/lib/components/RetentionDialog.svelte | Renames retention keys and UI text to run retention |
| web/frontend/src/lib/components/RecentRunsTable.svelte | Table relabeled and routes updated to /runs |
| web/frontend/src/lib/components/RecentAssessmentsSection.svelte | New/renamed component for recent assessments list |
| web/frontend/src/lib/components/PackSimulationsSheet.svelte | Sheet sizing/scroll improvements |
| web/frontend/src/lib/components/PackParametersDialog.svelte | Responsive dialog sizing update |
| web/frontend/src/lib/components/NewAssessmentTypeDialog.svelte | “New Assessment” dialog copy + route fix |
| web/frontend/src/lib/components/NewAssessmentDialog.svelte | Starts run from selected assessment (API + copy updates) |
| web/frontend/src/lib/components/LiveLog.svelte | Removes component (superseded) |
| web/frontend/src/lib/components/connectors/ConnectorEditDialog.svelte | Responsive dialog sizing update |
| web/frontend/src/lib/components/connectors/ConnectorCreateDialog.svelte | Responsive dialog sizing update |
| web/frontend/src/lib/api/client.ts | API client renamed/rewired to assessments/runs/expectations endpoints |
| openspec/specs/scenarios/spec.md | Spec updated for assessment resource model + endpoints |
| openspec/specs/runs/spec.md | Spec updated for assessment-linked runs + expectations vocabulary |
| openspec/specs/assessment-retention/spec.md | Spec updated for run retention key vocabulary |
| openspec/changes/archive/2026-06-24-assessment-vocabulary-refactor/tasks.md | Archives change tasks/checklist |
| openspec/changes/archive/2026-06-24-assessment-vocabulary-refactor/specs/scenarios/spec.md | Archived modified scenarios spec excerpt |
| openspec/changes/archive/2026-06-24-assessment-vocabulary-refactor/specs/runs/spec.md | Archived modified runs spec excerpt |
| openspec/changes/archive/2026-06-24-assessment-vocabulary-refactor/specs/assessment-retention/spec.md | Archived modified retention spec excerpt |
| openspec/changes/archive/2026-06-24-assessment-vocabulary-refactor/proposal.md | Archived proposal write-up |
| openspec/changes/archive/2026-06-24-assessment-vocabulary-refactor/design.md | Archived design notes/decisions |
| openspec/changes/archive/2026-06-24-assessment-vocabulary-refactor/.openspec.yaml | Archived OpenSpec metadata |
| internal/web/types.go | Web API request/response types renamed (assessmentId, expectations) |
| internal/web/server.go | Routes migrated to /assessments + /runs model |
| internal/web/scheduler.go | Scheduler store wiring renamed to assessment store |
| internal/web/schedule_handler.go | Schedule handler wired to assessment store + new route |
| internal/web/scenarios.go | ScenarioService now runs assessments + expectation progress persistence |
| internal/web/scenario_results.go | ScenarioResult row projection updated (expectations + errored) |
| internal/web/scenario_results_test.go | Tests updated for expectations + errored semantics |
| internal/web/scenario_export.go | Export wiring updated to runner.ScenarioResult and expectations |
| internal/web/run_deletion.go | Sweeper renamed to SweepRuns and log messages updated |
| internal/web/retention_test.go | Retention tests updated to SweepRuns |
| internal/web/elastic_rules_handlers.go | Coverage handler now uses assessments + expectation results |
| internal/web/coverage.go | Coverage mapping now consumes assessments + expectation results |
| internal/web/coverage_test.go | Coverage tests updated for assessments/expectations |
| internal/web/connector_handlers.go | Connector handlers store wiring renamed to assessment store |
| internal/web/api_schedules_test.go | Schedule API tests updated for assessment routes/types |
| internal/web/api_scenarios_test.go | Scenario CRUD tests migrated to assessments + run ingress |
| internal/web/api_runs_test.go | Runs tests updated for assessment-linked fields and filters |
| internal/web/api_config_test.go | Config tests updated for run retention key names |
| internal/testutil/fakes/fakes.go | Fake stores updated (assessments store + expectation updates + retention keys) |
| internal/testutil/fakes/fakes_test.go | Fake-store tests updated for expectations partial updates |
| internal/runner/scenario.go | Introduces runner.ScenarioResult/RunResult and expectation types |
| internal/results/types.go | Removes duplicate result types (now anchored on runner types) |
| internal/results/executor.go | Executor now consumes/returns runner.ScenarioResult and calls Runner.Run(scenario) |
| internal/parser/main.go | Parser uses Matchers/Expectations vocabulary and errors |
| internal/matchers/elastic/types.go | Elastic matcher struct/type rename |
| internal/matchers/elastic/elastic.go | Elastic matcher method receivers renamed |
| internal/matchers/elastic/elastic_test.go | Elastic matcher tests updated for new names |
| internal/matchers/datadog/types.go | Datadog matcher struct/type rename |
| internal/matchers/datadog/datadog.go | Datadog matcher method receivers renamed |
| internal/matchers/datadog/datadog_test.go | Datadog matcher tests updated for new names |
| internal/db/scenarios.go | Removes old saved_scenarios store implementation |
| internal/db/migrations/016_add_scenario_errored.up.sql | Adds scenario_results.errored column |
| internal/db/migrations/016_add_scenario_errored.down.sql | Drops scenario_results.errored column |
| internal/db/migrations/015_rename_retention_appconfig_keys.up.sql | Migrates assessment_* retention keys → run_* |
| internal/db/migrations/015_rename_retention_appconfig_keys.down.sql | Reverts run_* retention keys → assessment_* |
| internal/db/migrations/014_rename_scenario_results_assertions_to_expectations.up.sql | Renames assertions column → expectations |
| internal/db/migrations/014_rename_scenario_results_assertions_to_expectations.down.sql | Reverts expectations column → assertions |
| internal/db/migrations/013_rename_runs_scenario_id_to_assessment_id.up.sql | Renames runs.scenario_id → assessment_id (+ index) |
| internal/db/migrations/013_rename_runs_scenario_id_to_assessment_id.down.sql | Reverts runs.assessment_id → scenario_id (+ index) |
| internal/db/migrations/012_rename_saved_scenarios_to_assessments.up.sql | Renames saved_scenarios table → assessments + unique name constraint |
| internal/db/migrations/012_rename_saved_scenarios_to_assessments.down.sql | Reverts assessments → saved_scenarios (keeps disambiguated names) |
| internal/db/config.go | Config parsing/serialization updated to run retention keys |
| internal/db/config_test.go | Config tests updated to run retention keys |
| internal/db/assessments.go | New AssessmentStore implementation replacing ScenarioStore |
| internal/config/appconfig.go | AppConfig updated to run retention keys |
| internal/config/appconfig_test.go | Default config tests updated for renamed fields |
| internal/collectors/collector.go | Comment vocabulary updated (assertions → expectations) |
| cmd/simrun/main.go | Wires assessment store + runs retention sweeps |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Normalizes core domain vocabulary across the entire stack (DB → API → frontend) —
saved_scenarios→ assessments,assertions→ expectations — then builds on that foundation with per-run execution-error tracking surfaced in a redesigned runs list, and removes dead frontend components.Vocabulary normalization (core refactor)
saved_scenariostable →assessments;ScenarioStore→AssessmentStore(migration 012)runs.scenario_id→assessment_id(013);scenario_results.assertions→expectations(014)AppConfigkeys renamed from assessment-scoped to run/run-log scoped (015);SweepAssessments→SweepRuns,AssessmentLogRetention→RunLogRetentionscenariosstore →assessmentsstore,/scenarios→/assessmentsroutes, client + types updatedassessment-vocabulary-refactorchange and update living specsRun execution-error tracking (feature)
scenario_results.erroredcolumn (migration 016), computed at write time: a scenario errored when it failed without producing per-expectation results (warmup/detonation/matching-infra failures), as opposed to a clean expectation misserrorscount (a subset offailed), derived per run fromscenario_resultsRuns list redesign (UI)
Cleanup
RunCard,LiveLog,SimulationDetailSheet