Skip to content

[codex] Remove preconditions from test spec schema#28

Merged
droid-ash merged 1 commit into
devfrom
codex/remove-preconditions-schema
Mar 31, 2026
Merged

[codex] Remove preconditions from test spec schema#28
droid-ash merged 1 commit into
devfrom
codex/remove-preconditions-schema

Conversation

@droid-ash
Copy link
Copy Markdown
Contributor

@droid-ash droid-ash commented Mar 31, 2026

Summary

  • remove preconditions from the shared FinalRun test spec shape
  • reject preconditions: in YAML specs as an unsupported key during CLI parsing
  • remove preconditions handling from goal compilation, authored run snapshots, and test generation guidance

Why

preconditions is no longer part of the supported test spec schema. This change makes that break explicit instead of silently tolerating the field in YAML, compiled goals, and manifest metadata.

Developer Impact

Specs that still include preconditions: will now fail validation with contains unsupported key "preconditions". Existing specs need to delete that key before running finalrun check or finalrun test.

Historical run artifacts are left as-is. The report renderer does not depend on preconditions structurally, so older artifact JSON can continue to load without a migration.

Validation

  • npm install
  • npm run build --workspace=@finalrun/common
  • npm run build --workspace=@finalrun/device-node
  • npm run build --workspace=@finalrun/goal-executor
  • npm run build --workspace=finalrun-agent
  • node --test packages/cli/dist/src/workspace.test.js packages/cli/dist/src/finalrun.test.js packages/cli/dist/src/testRunner.test.js packages/cli/dist/src/reportTemplates.test.js
  • npx tsx --test packages/report-web/src/renderers.test.ts

Summary by CodeRabbit

  • Refactor

    • Removed support for the preconditions field in test specifications. Specs containing this field will now fail validation with an unsupported key error.
  • Tests

    • Added validation tests to ensure test specifications with preconditions are properly rejected.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e5430f57-6696-4124-8801-6cadf3120684

📥 Commits

Reviewing files that changed from the base of the PR and between 95151f8 and 70c1e36.

📒 Files selected for processing (10)
  • packages/cli/src/finalrun.test.ts
  • packages/cli/src/reportTemplates.test.ts
  • packages/cli/src/reportWriter.ts
  • packages/cli/src/specCompiler.ts
  • packages/cli/src/specLoader.ts
  • packages/cli/src/testRunner.test.ts
  • packages/cli/src/workspace.test.ts
  • packages/common/src/models/RepoTestSpec.ts
  • packages/report-web/src/renderers.test.ts
  • skills/generate-finalrun-test/SKILL.md
💤 Files with no reviewable changes (8)
  • packages/report-web/src/renderers.test.ts
  • packages/cli/src/reportTemplates.test.ts
  • skills/generate-finalrun-test/SKILL.md
  • packages/cli/src/specCompiler.ts
  • packages/cli/src/testRunner.test.ts
  • packages/cli/src/reportWriter.ts
  • packages/cli/src/specLoader.ts
  • packages/common/src/models/RepoTestSpec.ts

📝 Walkthrough

Walkthrough

The changes systematically remove support for the preconditions field from CLI specs. The preconditions property is deleted from the RepoTestSpec interface, spec loader/compiler/reporter logic, and test fixtures. Two new test cases verify that specs containing preconditions are properly rejected with validation errors.

Changes

Cohort / File(s) Summary
Type Definitions
packages/common/src/models/RepoTestSpec.ts
Removed preconditions: string[] property from exported RepoTestSpec interface.
Spec Loading & Parsing
packages/cli/src/specLoader.ts
Removed preconditions from accepted top-level keys and excluded it from binding reference detection.
Spec Compilation
packages/cli/src/specCompiler.ts
Removed generation of the "Preconditions" bullet section from compiled goal text.
Report Output
packages/cli/src/reportWriter.ts
Removed preconditions from authored spec snapshots and manifest serialization; excluded from binding reference collection.
Validation Tests
packages/cli/src/finalrun.test.ts, packages/cli/src/workspace.test.ts
Added test cases verifying that specs with preconditions keys are rejected with "unsupported key" errors.
Test Fixtures
packages/cli/src/reportTemplates.test.ts, packages/cli/src/testRunner.test.ts, packages/report-web/src/renderers.test.ts
Removed preconditions field from inline LoadedRepoTestSpec and manifest fixture objects.
Documentation
skills/generate-finalrun-test/SKILL.md
Removed preconditions key from test-spec YAML schema and instruction guidelines.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Preconditions once danced in our specs,
But now they've hopped away with their checks,
A feature removed, clean and neat,
Tests confirm the rejection's complete! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: removing the preconditions field from the test spec schema across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/remove-preconditions-schema

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@droid-ash droid-ash self-assigned this Mar 31, 2026
@droid-ash droid-ash marked this pull request as ready for review March 31, 2026 03:29
@droid-ash
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 31, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@droid-ash droid-ash changed the base branch from main to dev March 31, 2026 03:32
@droid-ash droid-ash merged commit 2c7675f into dev Mar 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant