Skip to content

[plan] Fix safe-outputs import gaps: missing operation types, YAML tag mismatches, and unmerged meta fields #17907

@github-actions

Description

@github-actions

Context

From schema consistency discussion #17876 (2026-02-23 run, findings 11–13 and two carryovers from Strategy-11).

Objective

Fix four related bugs in the safe-outputs system where import conflict detection, YAML serialization, and field merging produce silent incorrect behavior.

Issues to Fix

1. hasSafeOutputType() missing 11 operation type keys (carryover from Strategy-11)

  • File: pkg/workflow/imports.go:422
  • The switch statement is missing 11 operation types, meaning import conflict detection silently passes through conflicts for those types.
  • Add all missing operation type keys to the switch in hasSafeOutputType().

2. Serena languages schema enum restricted to 6 but runtime supports 32 (carryover from Strategy-11)

  • File: pkg/parser/schemas/main_workflow_schema.json (tools.serena.languages items.enum)
  • Schema enum only allows 6 Serena languages, but SerenaLanguageSupport in runtime_detection.go maps 32.
  • Expand the schema items.enum to match all 32 languages supported by SerenaLanguageSupport, or remove the enum restriction.

3. SafeOutputsConfig plural YAML tags mismatch singular schema keys

  • File: pkg/workflow/compiler_types.go:476-522
  • 7 struct fields use plural yaml tags (e.g., create-issues) that don't match the singular schema keys (e.g., create-issue).
    • CreateIssues → yaml:create-issues vs schema:create-issue
    • CreateDiscussions, CloseDiscussions, AddComments, CreatePullRequests, CreatePullRequestReviewComments, UpdateIssues — same pattern.
  • Parsing uses direct map key lookups so runtime behavior is correct, but marshaling back to YAML would fail additionalProperties: false validation.
  • Fix the yaml struct tags to use singular form matching the schema keys.

4. SafeOutputsConfig meta fields not merged from imported workflows

  • File: pkg/workflow/imports.go:655-720
  • Five meta fields are never merged when importing workflow configs:
    • Footer *bool
    • AllowGitHubReferences []string
    • GroupReports bool
    • MaxBotMentions *string
    • Mentions *MentionsConfig
  • Add merge logic for these fields in the import merge function.

Files to Modify

  • pkg/workflow/imports.go
  • pkg/workflow/compiler_types.go
  • pkg/parser/schemas/main_workflow_schema.json

Acceptance Criteria

  • hasSafeOutputType() switch covers all operation types (no silent pass-through)
  • Serena languages schema enum includes all 32 supported languages
  • SafeOutputsConfig yaml tags use singular form matching schema keys
  • Meta fields (Footer, AllowGitHubReferences, GroupReports, MaxBotMentions, Mentions) are merged from imported workflow configs
  • Run make agent-finish with no errors before committing
  • Run make build after schema changes (schemas are embedded via //go:embed)

Generated by Plan Command for issue #discussion #17876

  • expires on Feb 25, 2026, 12:04 PM UTC

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions