Skip to content

feat: add runtime presets & permissions - #128

Open
moshloop wants to merge 27 commits into
mainfrom
feat/runtime-presets-and-permissions
Open

moshloop wants to merge 27 commits into
mainfrom
feat/runtime-presets-and-permissions

Conversation

@moshloop

Copy link
Copy Markdown
Member

What

  • Add runtime presets as task specs with built-in defaults
  • Implement permission mode switching, tool aliases, and portable permission keys
  • Add native runtime adapter schemas with JSON Schema inventory and Go DTOs
  • Support @file/@url prompt expansion and Claude Agent effort parameters
  • Refactor spec layers to supply defaults only and remove RuntimeConstraints

Why

  • Simplify spec composition so layers strictly define defaults rather than restrictive ceilings
  • Provide structured task spec management and permission controls across agent providers

Notes

  • Breaking change: Removed RuntimeConstraints and restrictive model catalog

Claude-Session-Id: c1750ebd-c2e1-43bc-8962-5499fa2e65d7
A decoded `"permissions": {}` marked /permissions explicitly present, and
the explicit-path pass then overwrote the merged section with the zero
struct — dropping every inherited value the override never named, so a
request that merely mentioned the section erased the project's tool policy.

An explicit path naming an all-zero struct now merges field-wise instead of
replacing. Every value the override actually supplied inside the section
still carries its own explicit path and still wins, including a
deliberately emptied collection like `"tools": {}`.

Claude-Session: https://claude.ai/code/session_01QemSU28zWbxmrRuNKfoFPb

Claude-Session-Id: 2d8cf8c1-0626-49fd-b02b-654e7c1554fe
…s only

A spec layer is a source of defaults: the last layer naming a field owns it,
and no layer restricts what a later one may select. A posture that must
survive the whole stack is applied by its owner as the final layer rather
than hung off an earlier layer as a ceiling.

Deletes RuntimeConstraints and everything that folded it — the permission
ceiling lattice, the restrictive model catalog, run limits and usage quotas,
ValidateRuntimeConstraints, and the aichat/promptrun enforcement paths that
read them. Nothing outside tests ever produced a model or quota constraint,
and the permission lattice ranked only four of the six permission modes, so
a stack pairing an unranked posture (auto, dontAsk) with any other refused
to compose at all — one such pairing took down a whole run-context response.

ComposeSpecLayers is now the fold alone: order the layers, merge the specs,
record provenance, validate the effective budget.

Claude-Session: https://claude.ai/code/session_01QemSU28zWbxmrRuNKfoFPb

Claude-Session-Id: 2d8cf8c1-0626-49fd-b02b-654e7c1554fe
…nventory and Go DTOs

Claude-Session-Id: 01a08ec3-abce-7663-b1a3-546c0b710945
Claude-Session-Id: 01a09053-85e4-7382-9b30-5a4048a9c95f
Claude-Session-Id: d72dec9c-ff9c-4f1e-b821-264063be5727
Claude-Session-Id: c7ef9a1a-c38c-4d0e-bf53-db8d1829d974
…nt mapper config

Claude-Session-Id: 01a0a813-4df1-72f0-b045-3c31d672c8c0
…t-in defaults

Claude-Session-Id: 01a0a813-4df1-72f0-b045-3c31d672c8c0
Claude-Session-Id: 01a0a813-4df1-72f0-b045-3c31d672c8c0
…n chat

Claude-Session-Id: 01a0a813-4df1-72f0-b045-3c31d672c8c0
Claude-Session-Id: 01a0a813-4df1-72f0-b045-3c31d672c8c0
Claude-Session-Id: 01a0a813-4df1-72f0-b045-3c31d672c8c0
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 338 files, which is 238 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c84a924a-44ea-43d5-9f0e-066934bce801

📥 Commits

Reviewing files that changed from the base of the PR and between a0690b5 and 8b10d39.

⛔ Files ignored due to path filters (3)
  • go.sum is excluded by !**/*.sum
  • pkg/cli/webapp/dist/index.html is excluded by !**/dist/**
  • pkg/cli/webapp/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (338)
  • .agents/codex/captain.rules
  • .agents/skills/agents-mapper/SKILL.md
  • .agents/skills/agents-mapper/agents/openai.yaml
  • .agents/skills/agents-mapper/references/schema-contract.md
  • .github/workflows/publish-image.yml
  • cmd/captain/local_only_test.go
  • cmd/captain/runtime_entities_routes_test.go
  • docs/src/pages/prompts/index.mdx
  • docs/src/pages/prompts/runtime.mdx
  • go.mod
  • migrations/20_prompt_runs_and_plans.pg.hcl
  • migrations/41_runtime_profiles.pg.hcl
  • migrations/83_session_change_notify.sql
  • migrations/84_prompt_run_session_lifecycle.sql
  • migrations/prompt_run_session_lifecycle_integration_test.go
  • migrations/schema_ginkgo_test.go
  • migrations/session_change_notify_integration_test.go
  • pkg/adapters/adapters_suite_test.go
  • pkg/adapters/anthropic/agent.schema.json
  • pkg/adapters/anthropic/api.schema.json
  • pkg/adapters/anthropic/cli.schema.json
  • pkg/adapters/catalog.go
  • pkg/adapters/deepseek/api.schema.json
  • pkg/adapters/doc.go
  • pkg/adapters/generate.go
  • pkg/adapters/google/api.schema.json
  • pkg/adapters/google/cli.schema.json
  • pkg/adapters/openai/agent.schema.json
  • pkg/adapters/openai/api.schema.json
  • pkg/adapters/openai/cli.schema.json
  • pkg/adapters/schema_contract_ginkgo_test.go
  • pkg/adapters/zz_generated_anthropic_agent.go
  • pkg/adapters/zz_generated_anthropic_api.go
  • pkg/adapters/zz_generated_anthropic_cli.go
  • pkg/adapters/zz_generated_deepseek_api.go
  • pkg/adapters/zz_generated_google_api.go
  • pkg/adapters/zz_generated_google_cli.go
  • pkg/adapters/zz_generated_openai_agent.go
  • pkg/adapters/zz_generated_openai_api.go
  • pkg/adapters/zz_generated_openai_cli.go
  • pkg/ai/adapters_test.go
  • pkg/ai/agent/verify/verify.go
  • pkg/ai/assistanttags/assistanttags_suite_test.go
  • pkg/ai/assistanttags/envelope.go
  • pkg/ai/assistanttags/envelope_ginkgo_test.go
  • pkg/ai/cache/cache.go
  • pkg/ai/cache/cache_ginkgo_test.go
  • pkg/ai/callertools/credential_ginkgo_test.go
  • pkg/ai/callertools/runtime.go
  • pkg/ai/callertools/runtime_ginkgo_test.go
  • pkg/ai/catalog_resolve.go
  • pkg/ai/catalog_resolve_test.go
  • pkg/ai/history/agent_tool_vocabulary_ginkgo_test.go
  • pkg/ai/history/codex_dedupe_ginkgo_test.go
  • pkg/ai/history/codex_injected_ginkgo_test.go
  • pkg/ai/history/codex_messages.go
  • pkg/ai/history/codex_normalize_ginkgo_test.go
  • pkg/ai/history/codex_parser.go
  • pkg/ai/history/codex_permission_mode_ginkgo_test.go
  • pkg/ai/history/codex_types.go
  • pkg/ai/history/types.go
  • pkg/ai/internal/gen-model-registry/patches.json
  • pkg/ai/middleware/caching_test.go
  • pkg/ai/model_parse_conformance_test.go
  • pkg/ai/model_registry_test.go
  • pkg/ai/prompt/document.go
  • pkg/ai/prompt/document_test.go
  • pkg/ai/prompt/prompt.go
  • pkg/ai/provider/additional_directories_test.go
  • pkg/ai/provider/caller_tools_ginkgo_test.go
  • pkg/ai/provider/claude_cli.go
  • pkg/ai/provider/claude_cli_test.go
  • pkg/ai/provider/claudeagent/agent.ts
  • pkg/ai/provider/claudeagent/ask_question_ginkgo_test.go
  • pkg/ai/provider/claudeagent/attachments_ginkgo_test.go
  • pkg/ai/provider/claudeagent/bridge_params.go
  • pkg/ai/provider/claudeagent/caller_tools.go
  • pkg/ai/provider/claudeagent/caller_tools_ginkgo_test.go
  • pkg/ai/provider/claudeagent/effort_ginkgo_test.go
  • pkg/ai/provider/claudeagent/fake_agent_test.go
  • pkg/ai/provider/claudeagent/package.json
  • pkg/ai/provider/claudeagent/permission_capabilities_test.go
  • pkg/ai/provider/claudeagent/permission_mode_ginkgo_test.go
  • pkg/ai/provider/claudeagent/provider.go
  • pkg/ai/provider/claudeagent/provider_test.go
  • pkg/ai/provider/claudeagent/turn.go
  • pkg/ai/provider/cmux/provider.go
  • pkg/ai/provider/cmux/provider_test.go
  • pkg/ai/provider/codex_appserver.go
  • pkg/ai/provider/codex_appserver_approval.go
  • pkg/ai/provider/codex_appserver_lifecycle_ginkgo_test.go
  • pkg/ai/provider/codex_appserver_params_test.go
  • pkg/ai/provider/codex_appserver_permission_mode_ginkgo_test.go
  • pkg/ai/provider/codex_appserver_permissions_ginkgo_test.go
  • pkg/ai/provider/codex_appserver_protocol.go
  • pkg/ai/provider/codex_appserver_question_ginkgo_test.go
  • pkg/ai/provider/codex_appserver_turn.go
  • pkg/ai/provider/codex_cli.go
  • pkg/ai/provider/codex_cli_test.go
  • pkg/ai/provider/genkit/genkit.go
  • pkg/ai/provider/genkit/options.go
  • pkg/ai/provider/genkit/structured_stream_ginkgo_test.go
  • pkg/ai/runtime_selector_test.go
  • pkg/ai/schema_validation.go
  • pkg/ai/schema_validation_test.go
  • pkg/ai/terminal_outcome.go
  • pkg/ai/terminal_outcome_test.go
  • pkg/ai/types.go
  • pkg/aichat/README.md
  • pkg/aichat/approval_execution.go
  • pkg/aichat/approval_execution_test.go
  • pkg/aichat/execution_authority_ginkgo_test.go
  • pkg/aichat/execution_database.go
  • pkg/aichat/execution_database_authority.go
  • pkg/aichat/execution_database_integration_test.go
  • pkg/aichat/layered_profile_ownership_ginkgo_test.go
  • pkg/aichat/layered_runtime_profile.go
  • pkg/aichat/messages.go
  • pkg/aichat/provider_config.go
  • pkg/aichat/runtime_profile.go
  • pkg/aichat/runtime_profile_ginkgo_test.go
  • pkg/aichat/runtime_profile_selection_ginkgo_test.go
  • pkg/aichat/runtime_profiles_http.go
  • pkg/aichat/runtime_profiles_http_ginkgo_test.go
  • pkg/aichat/service.go
  • pkg/aichat/service_ginkgo_test.go
  • pkg/aichat/wire.go
  • pkg/api/agent_resources.go
  • pkg/api/codex_permission_mode_ginkgo_test.go
  • pkg/api/permission_capabilities.go
  • pkg/api/permission_capabilities_ginkgo_test.go
  • pkg/api/permissions.go
  • pkg/api/registry/anthropic_latest_ginkgo_test.go
  • pkg/api/registry/cost_test.go
  • pkg/api/registry/deepseek_default_ginkgo_test.go
  • pkg/api/registry/embed_test.go
  • pkg/api/registry/latest_models_ginkgo_test.go
  • pkg/api/registry/models.json
  • pkg/api/registry/provider.go
  • pkg/api/registry/providers.go
  • pkg/api/registry/runtime_mode_ginkgo_test.go
  • pkg/api/runtime_arguments.go
  • pkg/api/runtime_arguments_ginkgo_test.go
  • pkg/api/runtime_constraints.go
  • pkg/api/runtime_event.go
  • pkg/api/runtime_field_presentation.go
  • pkg/api/runtime_permission_constraints.go
  • pkg/api/runtime_permission_constraints_ginkgo_test.go
  • pkg/api/runtime_preset_codec.go
  • pkg/api/runtime_profile_layers_ginkgo_test.go
  • pkg/api/runtime_profiles.go
  • pkg/api/runtime_profiles_ginkgo_test.go
  • pkg/api/runtime_provider.go
  • pkg/api/runtime_sandbox_schema.go
  • pkg/api/sandbox_codex.go
  • pkg/api/sandbox_codex_ginkgo_test.go
  • pkg/api/spec_codec.go
  • pkg/api/spec_composition.go
  • pkg/api/spec_defaults_ginkgo_test.go
  • pkg/api/spec_layer_validation_ginkgo_test.go
  • pkg/api/spec_layers.go
  • pkg/api/spec_layers_ginkgo_test.go
  • pkg/api/spec_merge.go
  • pkg/api/spec_merge_presence_ginkgo_test.go
  • pkg/api/spec_provenance.go
  • pkg/api/spec_runtime_ginkgo_test.go
  • pkg/api/terminal_answers.go
  • pkg/api/terminal_answers_ginkgo_test.go
  • pkg/api/terminal_outcome.go
  • pkg/api/terminal_questions.go
  • pkg/api/terminal_questions_ginkgo_test.go
  • pkg/api/tool_aliases.go
  • pkg/api/tool_aliases_ginkgo_test.go
  • pkg/api/tool_policy_support_test.go
  • pkg/api/verify_merge.go
  • pkg/captainconfig/config.go
  • pkg/claude/history.go
  • pkg/claude/reader.go
  • pkg/claude/reader_injected_test.go
  • pkg/claude/reader_test.go
  • pkg/cli/ai_options.go
  • pkg/cli/ai_prompt_file.go
  • pkg/cli/ai_prompt_file_test.go
  • pkg/cli/ai_runtime_resolve_ginkgo_test.go
  • pkg/cli/event_renderer.go
  • pkg/cli/event_renderer_ginkgo_test.go
  • pkg/cli/permissions_matrix_test.go
  • pkg/cli/prompt_chat.go
  • pkg/cli/prompt_chat_ginkgo_test.go
  • pkg/cli/prompt_chat_http.go
  • pkg/cli/prompt_chat_permission_mode_ginkgo_test.go
  • pkg/cli/prompt_chat_persist_ginkgo_test.go
  • pkg/cli/prompt_chat_types.go
  • pkg/cli/prompt_entity.go
  • pkg/cli/prompt_help.go
  • pkg/cli/prompt_input_ginkgo_test.go
  • pkg/cli/prompt_layers.go
  • pkg/cli/prompt_layers_ginkgo_test.go
  • pkg/cli/prompt_observe.go
  • pkg/cli/prompt_profile_layers_ginkgo_test.go
  • pkg/cli/prompt_records.go
  • pkg/cli/prompt_render.go
  • pkg/cli/prompt_run.go
  • pkg/cli/prompt_run_failure_ginkgo_test.go
  • pkg/cli/prompt_run_iterations.go
  • pkg/cli/prompt_run_live.go
  • pkg/cli/prompt_run_persist.go
  • pkg/cli/prompt_run_persist_lifecycle_ginkgo_test.go
  • pkg/cli/prompt_run_persist_test.go
  • pkg/cli/prompt_schema_test.go
  • pkg/cli/prompt_source.go
  • pkg/cli/prompt_source_test.go
  • pkg/cli/prompt_spec.go
  • pkg/cli/runtime_entity_common.go
  • pkg/cli/runtime_entity_ginkgo_test.go
  • pkg/cli/runtime_preset_entity.go
  • pkg/cli/runtime_profile_catalog_ginkgo_test.go
  • pkg/cli/runtime_profile_entity.go
  • pkg/cli/serve.go
  • pkg/cli/serve_adapter_schemas.go
  • pkg/cli/serve_adapter_schemas_ginkgo_test.go
  • pkg/cli/serve_chat_profile.go
  • pkg/cli/serve_chat_profile_ginkgo_test.go
  • pkg/cli/serve_openapi.go
  • pkg/cli/session_follow.go
  • pkg/cli/session_follow_ginkgo_test.go
  • pkg/cli/session_get.go
  • pkg/cli/session_get_fold_db_ginkgo_test.go
  • pkg/cli/session_get_fold_ginkgo_test.go
  • pkg/cli/session_get_multi_test.go
  • pkg/cli/session_http.go
  • pkg/cli/session_http_ginkgo_test.go
  • pkg/cli/sessions.go
  • pkg/cli/testdata/permissions_matrix_test.md
  • pkg/cli/webapp/package.json
  • pkg/cli/webapp/src/AdapterSchemasPage.test.tsx
  • pkg/cli/webapp/src/AdapterSchemasPage.tsx
  • pkg/cli/webapp/src/App.tsx
  • pkg/cli/webapp/src/PromptDetailPane.test.tsx
  • pkg/cli/webapp/src/PromptDetailPane.tsx
  • pkg/cli/webapp/src/RuntimeProfilesPage.test.tsx
  • pkg/cli/webapp/src/RuntimeProfilesPage.tsx
  • pkg/cli/webapp/src/SessionDetail.test.tsx
  • pkg/cli/webapp/src/SessionDetail.tsx
  • pkg/cli/webapp/src/SessionTable.test.tsx
  • pkg/cli/webapp/src/SessionTable.tsx
  • pkg/cli/webapp/src/adapterSchemas.test.ts
  • pkg/cli/webapp/src/adapterSchemas.ts
  • pkg/cli/webapp/src/askAnswer.test.ts
  • pkg/cli/webapp/src/askAnswer.ts
  • pkg/cli/webapp/src/hooks/usePromptRunStream.test.tsx
  • pkg/cli/webapp/src/hooks/usePromptRunStream.ts
  • pkg/cli/webapp/src/hooks/useSessionChat.permissionMode.test.ts
  • pkg/cli/webapp/src/hooks/useSessionChat.test.ts
  • pkg/cli/webapp/src/hooks/useSessionChat.ts
  • pkg/cli/webapp/src/runtimeProfilesApi.test.ts
  • pkg/cli/webapp/src/runtimeProfilesApi.ts
  • pkg/cli/webapp/src/runtimeProfilesData.test.tsx
  • pkg/cli/webapp/src/runtimeProfilesData.ts
  • pkg/cli/webapp/src/runtimeProfilesRoute.test.ts
  • pkg/cli/webapp/src/runtimeProfilesRoute.ts
  • pkg/cli/webapp/src/sessionCollection.test.ts
  • pkg/cli/webapp/src/sessionData.ts
  • pkg/cli/webapp/src/shellHelpers.test.ts
  • pkg/cli/webapp/src/shellHelpers.ts
  • pkg/container/base/Dockerfile
  • pkg/database/prompt_run_operations.go
  • pkg/database/prompt_run_overview.go
  • pkg/database/prompt_run_store.go
  • pkg/database/runtime_profile_store.go
  • pkg/database/runtime_profile_store_integration_test.go
  • pkg/database/session_read_store.go
  • pkg/database/session_transcript_source_ginkgo_test.go
  • pkg/monitor/ingest.go
  • pkg/promptrun/README.md
  • pkg/promptrun/preflight.go
  • pkg/promptrun/preflight_constraints_ginkgo_test.go
  • pkg/promptrun/preflight_ginkgo_test.go
  • pkg/promptrun/preflight_runtime_ginkgo_test.go
  • pkg/promptrun/promptrun_ginkgo_test.go
  • pkg/promptrun/run.go
  • pkg/runtimeprofiles/README.md
  • pkg/runtimeprofiles/builtin/presets/edit.yaml
  • pkg/runtimeprofiles/builtin/presets/plan.yaml
  • pkg/runtimeprofiles/builtin/presets/read-only.yaml
  • pkg/runtimeprofiles/builtin_source.go
  • pkg/runtimeprofiles/builtin_source_ginkgo_test.go
  • pkg/runtimeprofiles/catalog.go
  • pkg/runtimeprofiles/db_source.go
  • pkg/runtimeprofiles/default_catalog.go
  • pkg/runtimeprofiles/default_catalog_ginkgo_test.go
  • pkg/runtimeprofiles/file_codec.go
  • pkg/runtimeprofiles/file_source.go
  • pkg/runtimeprofiles/layer_errors.go
  • pkg/runtimeprofiles/layer_validation_ginkgo_test.go
  • pkg/runtimeprofiles/layers_ginkgo_test.go
  • pkg/runtimeprofiles/references.go
  • pkg/runtimeprofiles/resolve.go
  • pkg/runtimeprofiles/resolver.go
  • pkg/runtimeprofiles/resolver_ginkgo_test.go
  • pkg/runtimeprofiles/types.go
  • pkg/session/awaiting_input.go
  • pkg/session/build.go
  • pkg/session/build_codex.go
  • pkg/session/build_codex_paths_test.go
  • pkg/session/build_codex_permission_mode_ginkgo_test.go
  • pkg/session/build_messages.go
  • pkg/session/identity.go
  • pkg/session/injected_messages_ginkgo_test.go
  • pkg/session/load/aggregate.go
  • pkg/session/load/awaiting_input.go
  • pkg/session/load/awaiting_input_ginkgo_test.go
  • pkg/session/load/load.go
  • pkg/session/load/projection.go
  • pkg/session/load/projection_ginkgo_test.go
  • pkg/session/load/promptrun.go
  • pkg/session/load/promptrun_ginkgo_test.go
  • pkg/session/metadata.go
  • pkg/session/metadata_ginkgo_test.go
  • pkg/session/permission_mode_ginkgo_test.go
  • pkg/session/pretty.go
  • pkg/session/pretty_compact_test.go
  • pkg/session/pretty_muted_test.go
  • pkg/session/query/fold.go
  • pkg/session/query/fold_ginkgo_test.go
  • pkg/session/query/follow.go
  • pkg/session/query/follow_facets.go
  • pkg/session/query/follow_facets_ginkgo_test.go
  • pkg/session/query/follow_ginkgo_test.go
  • pkg/session/query/follow_tail.go
  • pkg/session/query/follow_tail_ginkgo_test.go
  • pkg/session/query/follow_thread.go
  • pkg/session/query/notify.go
  • pkg/session/query/query.go
  • pkg/session/query/stored.go
  • pkg/session/session.go
  • pkg/session/transcript_pretty.go
  • pkg/session/turns.go

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

@github-actions

Copy link
Copy Markdown

Gavel summary

Source Pass Fail Skip Duration

Totals: 0 passed · 0 failed · 0 skipped · -

View full results

@github-actions

Copy link
Copy Markdown

Gavel results

Gavel exited with code 1.

View full results

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