Skip to content

Add missing safe-output configuration schema coverage - #53659

Merged
pelikhan merged 8 commits into
mainfrom
copilot/imp-004-add-missing-json-schema-properties
Aug 18, 2026
Merged

Add missing safe-output configuration schema coverage#53659
pelikhan merged 8 commits into
mainfrom
copilot/imp-004-add-missing-json-schema-properties

Conversation

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

IMP-004 found safe-output configuration fields implemented in Go but absent from the workflow JSON schema, reducing editor validation and autocomplete coverage.

  • Schema coverage

    • Added missing properties for comments, milestones, issue/PR creation, branch pushes, and threat detection.
    • Added safe-outputs.comment-memory configuration support.
  • Compiler-owned fields

    • Explicitly allowlisted workflow_files and aw_context_workflows in the conformance check because the compiler populates them; they remain excluded from user-facing schema.
  • Regression coverage

    • Added parser validation for the newly declared user-facing fields.
safe-outputs:
  add-comment:
    allows-comment-ids: [IC_kwDOABCD123456]
  assign-milestone:
    auto_create: true
  threat-detection:
    model: gpt-5
    environment: production

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 14.5 AIC · ⌖ 10.2 AIC · ⊞ 6.4K ·
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add 13 missing safe-outputs config properties to JSON schema Add missing safe-output configuration schema coverage Aug 18, 2026
Copilot AI requested a review from pelikhan August 18, 2026 12:02
@pelikhan
pelikhan marked this pull request as ready for review August 18, 2026 12:07
Copilot AI balanced review requested due to automatic review settings August 18, 2026 12:07
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Lean already. Ship. All changes are additive JSON schema properties, a regression test, and a small compiler-populated-fields allowlist in the conformance script — no reinvented logic, unused flexibility, or speculative abstractions to cut.

Generated by Ponytail Reviewer for #53659

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-18T00:00:00Z
review_event: REQUEST_CHANGES
top_themes:
  - schema/parser contract drift
  - comment-memory footer type mismatch
files_reviewed:
  - pkg/parser/schema_safe_outputs_target_test.go
  - pkg/parser/schemas/main_workflow_schema.json
  - scripts/check-safe-outputs-conformance.sh
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 8.96 AIC · ⌖ 6.81 AIC · ⊞ 7K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The changes look correct and well-structured. Schema additions are consistent with existing patterns, the new test provides good coverage of the added fields, and the conformance script fix correctly excludes compiler-populated fields from the missing-field check. No blocking issues found.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 16.2 AIC · ⌖ 8.75 AIC · ⊞ 5.7K

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Request changes

This patch adds useful schema coverage, but one of the new schema branches no longer matches the actual parser contract for safe-outputs.comment-memory, so it can now bless configurations that the compiler rejects.

The blocking theme
  • safe-outputs.comment-memory.footer is declared here as a plain boolean-only field, while the parser still preprocesses it as a templatable boolean string/expression path.
  • Reusing #/properties/tools/properties/comment-memory via anyOf also silently broadens the accepted shape to include max, github-token, staged, issue-intent, and samples, which were not mentioned in the new regression test.
  • That mismatch means schema validation can drift again instead of proving parity.

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 8.96 AIC · ⌖ 6.81 AIC · ⊞ 7K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /codebase-design and /tdd — requesting changes on two schema correctness issues.

📋 Key Themes & Highlights

Issues

  1. comment-memory safe-outputs anyOf arm 1 — $ref leak (main_workflow_schema.json line 7186): The $ref to the tools definition silently allows true/null shorthand forms in the safe-outputs context, which is likely unintended.
  2. comment-memory safe-outputs anyOf arm 2 — open object (main_workflow_schema.json line 7212): Missing "additionalProperties": false means unknown fields pass validation, breaking the guard that all other safe-outputs config objects enforce.
  3. Happy-path-only test (schema_safe_outputs_target_test.go line 48): A negative test covering at least one invalid field would turn this into a proper regression guard.

Positive Highlights

  • ✅ The conformance-script change (compiler_populated_fields allowlist) is clean and well-scoped.
  • ✅ All other new schema properties (require-temporary-id, base-branch, auto_create, engine-config, model, environment) are well-formed and use consistent style.
  • ✅ Good coverage of the PR body's stated IMP-004 scope.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 32.8 AIC · ⌖ 11.3 AIC · ⊞ 7.8K
Comment /matt to run again

},
"memory-id": {
"type": "string",
"description": "Default memory identifier when an item does not provide memory_id."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/codebase-design] The new comment-memory safe-outputs branch (the second anyOf arm) lacks "additionalProperties": false, so unknown fields won't be caught by schema validation.

💡 Suggested fix

Add "additionalProperties": false to the inline object branch — every other safe-outputs config object in this schema closes with it; this branch is the only exception introduced by this PR.

{
  "type": "object",
  "properties": { ... },
  "additionalProperties": false
}

@copilot please address this.

],
"description": "Enable AI agents to add comments to GitHub issues, pull requests, or discussions. Supports templating, cross-repository commenting, and automatic mentions."
},
"comment-memory": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/codebase-design] The comment-memory safe-outputs entry's first anyOf arm is $ref: #/properties/tools/properties/comment-memory. The referenced tools definition is itself a oneOf that includes true and null shorthand variants, so those are silently allowed here too. Unless true/null are valid in the safe-outputs context, consider using a plain inline object with additionalProperties: false (matching the create-pull-request and create-issue patterns) rather than a $ref to the tools definition.

@copilot please address this.

}

if err := ValidateMainWorkflowFrontmatterWithSchemaAndLocation(frontmatter, "/tmp/gh-aw/safe-output-config-coverage-test.md"); err != nil {
t.Fatalf("expected safe-output configuration fields to pass schema validation, got: %v", err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/tdd] The new test only validates the happy path. Per the pattern in this file, adding at least one negative case would give this schema regression real value — e.g. an unknown field in assign-milestone or a wrong type for auto_create.

💡 Suggested addition
func TestMainWorkflowSchema_SafeOutputConfigCoverage_InvalidField(t *testing.T) {
	t.Parallel()

	frontmatter := map[string]any{
		"on":     "push",
		"engine": "copilot",
		"safe-outputs": map[string]any{
			"assign-milestone": map[string]any{
				"not_a_real_field": true,
			},
		},
	}

	if err := ValidateMainWorkflowFrontmatterWithSchemaAndLocation(frontmatter, "/tmp/gh-aw/safe-output-config-negative-test.md"); err == nil {
		t.Fatal("expected schema validation to reject unknown field, but got no error")
	}
}

@copilot please address this.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds missing safe-output fields to the workflow schema for validation and editor tooling.

Changes:

  • Expands safe-output schema coverage.
  • Excludes compiler-populated fields from conformance checks.
  • Adds schema regression validation.
Show a summary per file
File Description
scripts/check-safe-outputs-conformance.sh Excludes compiler-owned fields.
pkg/parser/schemas/main_workflow_schema.json Declares missing safe-output properties.
pkg/parser/schema_safe_outputs_target_test.go Tests schema acceptance.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Suppressed comments (1)

pkg/parser/schemas/main_workflow_schema.json:7216

  • CommentMemoryConfig.Footer is a templatable string field, and parseCommentMemoryConfigValue uses preprocessBoolFieldAsString, which accepts both booleans and GitHub Actions expressions. This boolean-only declaration rejects the expression form supported by the Go implementation.
                "footer": {
                  "type": "boolean",
                  "description": "Controls whether the AI-generated footer is added to the managed comment."
  • Files reviewed: 3/3 changed files
  • Comments generated: 5
  • Review effort level: Balanced

Comment on lines +7081 to +7086
"allows-comment-ids": {
"type": "array",
"description": "Trusted allowlist of issue or pull request comment IDs the agent may update when target is '*'.",
"items": {
"type": "string"
}
Comment on lines +7088 to +7094
"hide-older-comments-match": {
"type": "array",
"description": "Exact workflow IDs whose older comments are eligible to be hidden.",
"items": {
"type": "string"
}
},
Comment on lines +11007 to +11014
"engine-config": {
"$ref": "#/$defs/engine_config",
"description": "Extended engine configuration for threat detection."
},
"model": {
"type": "string",
"description": "Model override for threat detection engine execution."
},
Comment on lines +11045 to +11048
"environment": {
"type": "string",
"description": "GitHub Actions environment override for the detection job."
},
Comment on lines +7186 to +7190
"comment-memory": {
"description": "Comment memory configuration for managed comment persistence.",
"anyOf": [
{
"$ref": "#/properties/tools/properties/comment-memory"
Draft ADR documenting the decision to add missing safe-output configuration
fields to the workflow JSON schema and allowlist compiler-populated fields
in the IMP-004 conformance checker.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (122 new lines in pkg/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/53659-add-safe-output-config-fields-to-json-schema.md — review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch — it was generated from the PR diff and linked issue [Safe Outputs Conformance] IMP-004: 13 safe-outputs config properties missing from JSON schema #53604
  2. Complete the missing sections — add context the AI couldn't infer, refine the decision rationale, and list real alternatives you considered
  3. Commit the finalized ADR to docs/adr/ on your branch
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-53659: Add Missing Safe-Output Config Fields to JSON Schema

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

❓ Why ADRs Matter

"AI made me procrastinate on key design decisions. Because refactoring was cheap, I could always say 'I'll deal with this later.' Deferring decisions corroded my ability to think clearly."

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number (e.g., 0042-use-postgresql.md for PR #42).

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · sonnet46 · 73.1 AIC · ⌖ 18.7 AIC · ⊞ 9.1K ·
Comment /review to run again

@github github deleted a comment from flynnjustin24 Aug 18, 2026
@github github deleted a comment from flynnjustin24 Aug 18, 2026
@github github deleted a comment from flynnjustin24 Aug 18, 2026
@github github deleted a comment from flynnjustin24 Aug 18, 2026
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please address the remaining blocking review feedback on this PR, then run the pr-finisher skill and report back with validation results and any remaining blockers.

  • Unresolved blocking feedback covers schema/parser drift for safe-outputs.comment-memory.footer, over-broad/open schema acceptance for comment-memory, and the missing negative regression coverage.
  • No failed checks were listed in the compact queue for this run.
  • Please refresh the branch if needed and include the validation commands/results in your follow-up.

Run: https://github.com/github/gh-aw/actions/runs/32140009662

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 14.5 AIC · ⌖ 10.2 AIC · ⊞ 6.4K ·
Comment /souschef to run again

Copilot AI and others added 2 commits August 18, 2026 13:28
…issing-json-schema-properties

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please address the remaining blocking review feedback on this PR, then run the pr-finisher skill and report back with validation results and any remaining blockers.

  • Unresolved blocking f...

Addressed in 0fc0f52: comment-memory remains tools-only, safe-outputs.comment-memory is rejected by schema regression coverage, and IMP-004 explicitly excludes the tools-configured handler.

Copilot AI requested a review from gh-aw-bot August 18, 2026 13:34
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot remove safe-outputs.comment-memory from schema and parser, go types.

Only tools.comment-memory is valid

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot remove safe-outputs.comment-memory from schema and parser, go types.

Only tools.comment-memory is valid

Addressed in 1d171e8. comment-memory is now tools-owned only; the safe-output schema, parser descriptor, and SafeOutputsConfig field no longer expose it.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts on this branch.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts on this branch.

Resolved and merged current main in f87dc22160. The schema conflict retains both independent properties.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

PR-finisher completed. Targeted parser tests and workflow recompilation pass. The branch has no local changes, but merge readiness is blocked by unresolved review threads and repository-wide validation failures from current main (testifylint violations and WASM golden drift). CI is currently in progress and must be re-triggered by a maintainer after any further push.

@pelikhan
pelikhan merged commit 26d151f into main Aug 18, 2026
25 of 26 checks passed
@pelikhan
pelikhan deleted the copilot/imp-004-add-missing-json-schema-properties branch August 18, 2026 17:29
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Safe Outputs Conformance] IMP-004: 13 safe-outputs config properties missing from JSON schema

5 participants