Skip to content

Extend semantic-type convention: add ArtifactName/Filename/FilePath to pkg/constants - #55787

Merged
pelikhan merged 6 commits into
mainfrom
copilot/deep-report-extend-semantic-type-convention
Aug 25, 2026
Merged

pelikhan merged 6 commits into
mainfrom
copilot/deep-report-extend-semantic-type-convention

Conversation

Copilot AI commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

pkg/constants already defines semantic string types (JobName, StepID, MCPServerID, CommandPrefix, WorkflowID) to prevent mixing unrelated string identifiers, but dozens of artifact names, filenames, and file paths in job_constants.go/constants.go remained bare string constants — making it possible to pass an artifact name where a filename was expected without a compile error.

New semantic types (pkg/constants/constants.go)

  • ArtifactName, Filename, FilePath — added alongside existing types, each with String()/IsValid() methods matching the established convention.

Retyped constants

  • Artifact names → ArtifactName: SafeOutputArtifactName, AgentOutputArtifactName, AgentArtifactName, DetectionArtifactName, EvalsArtifactName, ActivationArtifactName, ExperimentArtifactName, UsageArtifactName, SafeOutputItemsArtifactName, SarifArtifactName, LegacyDetectionArtifactName, and others.
  • Filenames → Filename: AgentOutputFilename, SafeOutputsFilename, EvalsResultFilename, TokenUsageFilename, grader/OTLP filenames, TemporaryIdMapFilename, SarifFileName.
  • Paths → FilePath: AWFProxyLogsDir, AWFAuditDir, PreAgentAuditFilePath, AWFConfigFilePath, AWFReflectFilePath, SarifArtifactDownloadPath.
  • AWFDefaultCommand → existing CommandPrefix type.

Call site fixes

  • Updated ~90 usages across pkg/workflow and pkg/cli (and tests) that concatenated or compared these constants as bare strings, using .String() or string(...) conversions where the compiler now requires an explicit conversion.
// Before: implicit string, no protection against mixing types
name := prefix + constants.AgentArtifactName

// After: compile error unless explicitly converted
name := prefix + constants.AgentArtifactName.String()

Scope

  • Left GhAwRootDir/TmpGhAwDir and their many derived Tmp*/*Expr/*Shell constants untyped — they're referenced in hundreds of places to build shell/Actions-expression strings, and retyping them would carry a disproportionately large blast radius relative to the rest of this change.

pr-sous-chef run: https://github.com/github/gh-aw/actions/runs/32874927562

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 31.4 AIC · ⌖ 8.24 AIC · ⊞ 8.7K · ◷
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ArtifactName, Filename, and FilePath types to pkg/constants Extend semantic-type convention: add ArtifactName/Filename/FilePath to pkg/constants Aug 25, 2026
Copilot AI requested a review from pelikhan August 25, 2026 13:58
@pelikhan
pelikhan marked this pull request as ready for review August 25, 2026 14:00
Copilot AI balanced review requested due to automatic review settings August 25, 2026 14:00

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 semantic types for artifact names, filenames, and paths, then updates affected workflow compiler and CLI call sites.

Changes:

  • Adds ArtifactName, Filename, and FilePath.
  • Retypes constants and AWFDefaultCommand.
  • Adds explicit string conversions across consumers and tests.
Show a summary per file
File Description
pkg/workflow/threat_detection_steps.go Converts detection names and paths.
pkg/workflow/threat_detection_steps_test.go Updates detection expectations.
pkg/workflow/threat_detection_job.go Converts activation artifact name.
pkg/workflow/threat_detection_firewall_test.go Converts firewall paths.
pkg/workflow/threat_detection_external.go Converts detection artifact name.
pkg/workflow/step_order_validation.go Converts evaluator filename.
pkg/workflow/sandbox_runtime_profile.go Converts AWF command prefix.
pkg/workflow/safe_outputs_steps.go Converts artifact metadata.
pkg/workflow/safe_jobs.go Converts agent artifact metadata.
pkg/workflow/otel_observability_formal_test.go Converts OTEL filename.
pkg/workflow/notify_comment.go Converts conclusion artifact names.
pkg/workflow/notify_comment_test.go Updates artifact expectations.
pkg/workflow/evals_steps.go Converts eval filename and artifact.
pkg/workflow/evals_job.go Converts eval artifact name.
pkg/workflow/engine_firewall_support.go Converts firewall paths.
pkg/workflow/engine_firewall_support_test.go Updates firewall expectation.
pkg/workflow/create_code_scanning_alert.go Converts SARIF metadata.
pkg/workflow/compiler_yaml_runtime_setup.go Converts activation artifact name.
pkg/workflow/compiler_yaml_post_agent.go Converts collected artifact paths.
pkg/workflow/compiler_yaml_graders.go Converts grader filenames.
pkg/workflow/compiler_yaml_artifacts.go Converts fallback filenames.
pkg/workflow/compiler_safe_outputs_job.go Converts agent artifact names.
pkg/workflow/compiler_safe_outputs_job_test.go Updates SARIF path expectation.
pkg/workflow/compiler_experiments.go Converts experiment artifact names.
pkg/workflow/compiler_artifacts_test.go Converts evaluator filename.
pkg/workflow/compiler_activation_outputs.go Converts activation metadata.
pkg/constants/spec_test.go Updates typed AWF assertions.
pkg/constants/job_constants.go Retypes artifact and filename constants.
pkg/constants/constants.go Defines semantic types and typed paths.
pkg/constants/constants_test.go Updates constant-value assertions.
pkg/cli/trial_support.go Converts agent-output filename.
pkg/cli/logs_utils.go Converts legacy artifact name.
pkg/cli/logs_skill_activations_test.go Updates fixture paths.
pkg/cli/logs_safe_output_chains.go Converts temporary-ID filename.
pkg/cli/logs_safe_output_chains_test.go Updates temporary-ID fixtures.
pkg/cli/logs_run_processor.go Converts artifact and eval metadata.
pkg/cli/logs_run_processor_test.go Updates eval fixtures.
pkg/cli/logs_noop_test.go Updates agent-output fixtures.
pkg/cli/logs_missing_tool_test.go Updates missing-tool fixtures.
pkg/cli/logs_missing_data_test.go Updates missing-data fixtures.
pkg/cli/logs_metrics.go Converts agent-output paths.
pkg/cli/logs_github_rate_limit_usage.go Converts rate-limit filename.
pkg/cli/logs_flatten_test.go Updates fallback artifact fixtures.
pkg/cli/logs_download.go Converts artifact filters.
pkg/cli/logs_download_test.go Updates critical artifact expectations.
pkg/cli/logs_download_flatten.go Converts artifact directory names.
pkg/cli/logs_download_artifacts.go Converts critical artifact names.
pkg/cli/logs_artifact_set.go Converts artifact-set mappings.
pkg/cli/logs_artifact_set_test.go Updates artifact-set expectations.
pkg/cli/logs_artifact_compat_test.go Updates compatibility fixtures.
pkg/cli/graders_operational_value_regrade.go Converts grader filenames.
pkg/cli/firewall_policy.go Converts audit path.
pkg/cli/experiments_grader_observations.go Converts grader artifact metadata.
pkg/cli/experiments_fetch.go Converts eval filename.
pkg/cli/evals_branch.go Converts eval paths.
pkg/cli/audit_test.go Updates temporary-ID fixture.
pkg/cli/audit_run_pipeline.go Converts audit artifact filters.
pkg/cli/audit_report.go Converts report filename key.
pkg/cli/audit_report_experiments.go Converts experiment paths.
pkg/cli/audit_diff.go Converts agent artifact filter.

Review details

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

  • Files reviewed: 60/60 changed files
  • Comments generated: 2
  • Review effort level: Balanced

const SafeOutputArtifactName = "safe-output"
const AgentOutputArtifactName = "agent-output"
const SafeOutputArtifactName ArtifactName = "safe-output"
const AgentOutputArtifactName ArtifactName = "agent-output"
Comment on lines +93 to +95
// IsValid returns true if the artifact name is non-empty
func (a ArtifactName) IsValid() bool {
return a != ""
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:

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

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 17.3 AIC · ⌖ 8.16 AIC · ⊞ 8.7K · ◷
Comment /souschef to run again

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

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.
...

Addressed in c6f59c8. I fixed the integration build break by converting the two filepath.Join uses in pkg/cli/logs_missing_tool_integration_test.go to constants.AgentOutputArtifactName.String(), and I added helper-method coverage rows for WorkflowID, ArtifactName, Filename, and FilePath in pkg/constants/constants_test.go. I also pulled the failing job logs for verify-integration-build and Windows Integration and confirmed both failures matched that compile issue.

Copilot AI requested a review from gh-aw-bot August 25, 2026 15:45
@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 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts on this branch.

Resolved in ac11bca. I merged origin/main, resolved the conflicts in pkg/cli/audit_report.go and pkg/cli/logs_safe_output_chains.go, and pushed the updated branch.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:

  • follow through on the recent merge-conflict resolution by rechecking the branch state and any remaining review concerns
  • refresh the branch if needed
  • use the pr-finisher skill before handing back for review

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

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 31.4 AIC · ⌖ 8.24 AIC · ⊞ 8.7K · ◷
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@pelikhan
pelikhan merged commit a4a5a5f into main Aug 25, 2026
@pelikhan
pelikhan deleted the copilot/deep-report-extend-semantic-type-convention branch August 25, 2026 17:48
Copilot stopped work on behalf of gh-aw-bot due to an error August 25, 2026 17:49
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.8

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.

[deep-report] Extend semantic-type convention in pkg/constants: add ArtifactName/Filename/FilePath types

4 participants