Skip to content

refactor(core): normalize core vocabulary#15

Merged
faloker merged 4 commits into
mainfrom
refactor/assessment-vocabulary
Jun 25, 2026
Merged

refactor(core): normalize core vocabulary#15
faloker merged 4 commits into
mainfrom
refactor/assessment-vocabulary

Conversation

@faloker

@faloker faloker commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Normalizes core domain vocabulary across the entire stack (DB → API → frontend) — saved_scenariosassessments, assertionsexpectations — 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)

  • Rename saved_scenarios table → assessments; ScenarioStoreAssessmentStore (migration 012)
  • runs.scenario_idassessment_id (013); scenario_results.assertionsexpectations (014)
  • Retention AppConfig keys renamed from assessment-scoped to run/run-log scoped (015); SweepAssessmentsSweepRuns, AssessmentLogRetentionRunLogRetention
  • Propagate "assertions → expectations" terminology through matchers (Elastic/Datadog), runner, collectors, and API types
  • Frontend: scenarios store → assessments store, /scenarios/assessments routes, client + types updated
  • OpenSpec: archive the assessment-vocabulary-refactor change and update living specs

Run execution-error tracking (feature)

  • New scenario_results.errored column (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 miss
  • Runs now expose an errors count (a subset of failed), derived per run from scenario_results
  • Tests encode the matching-failure-vs-execution-error distinction

Runs list redesign (UI)

  • Rework the runs table into a GitHub Actions "All workflows"-style layout: leading status glyph, consolidated primary + subtitle (id · type · author · time), results bar, right-aligned duration
  • Status icon reflects the new error signal: a completed run stays green even with expectation failures; the amber warning appears only on genuine execution errors

Cleanup

  • Remove unused components: RunCard, LiveLog, SimulationDetailSheet

Copilot AI review requested due to automatic review settings June 25, 2026 15:24
@github-actions github-actions Bot added the size/XXL PR size: XXL label Jun 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_idassessment_id, assertionsexpectations) and introduces scenario_results.errored to 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.

Comment thread openspec/specs/scenarios/spec.md
Comment thread openspec/specs/scenarios/spec.md
Comment thread internal/web/schedule_handler.go Outdated
Comment thread internal/web/scenario_results.go Outdated
Comment thread internal/web/schedule_handler.go Outdated
Comment thread internal/web/schedule_handler.go Outdated
@faloker faloker merged commit 4d08637 into main Jun 25, 2026
2 of 3 checks passed
@faloker faloker deleted the refactor/assessment-vocabulary branch June 25, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XXL PR size: XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants