Repository navigation
Extend semantic-type convention: add ArtifactName/Filename/FilePath to pkg/constants - #55787
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
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, andFilePath. - 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" |
| // IsValid returns true if the artifact name is non-empty | ||
| func (a ArtifactName) IsValid() bool { | ||
| return a != "" |
|
Please do one focused follow-up pass:
Run: https://github.com/github/gh-aw/actions/runs/32865603664
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Addressed in c6f59c8. I fixed the integration build break by converting the two |
|
@copilot resolve the merge conflicts on this branch. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Please do one focused follow-up pass:
Run: https://github.com/github/gh-aw/actions/runs/32874927562
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
🎉 This pull request is included in a new release. Release: |
pkg/constantsalready defines semantic string types (JobName,StepID,MCPServerID,CommandPrefix,WorkflowID) to prevent mixing unrelated string identifiers, but dozens of artifact names, filenames, and file paths injob_constants.go/constants.goremained barestringconstants — 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 withString()/IsValid()methods matching the established convention.Retyped constants
ArtifactName:SafeOutputArtifactName,AgentOutputArtifactName,AgentArtifactName,DetectionArtifactName,EvalsArtifactName,ActivationArtifactName,ExperimentArtifactName,UsageArtifactName,SafeOutputItemsArtifactName,SarifArtifactName,LegacyDetectionArtifactName, and others.Filename:AgentOutputFilename,SafeOutputsFilename,EvalsResultFilename,TokenUsageFilename, grader/OTLP filenames,TemporaryIdMapFilename,SarifFileName.FilePath:AWFProxyLogsDir,AWFAuditDir,PreAgentAuditFilePath,AWFConfigFilePath,AWFReflectFilePath,SarifArtifactDownloadPath.AWFDefaultCommand→ existingCommandPrefixtype.Call site fixes
pkg/workflowandpkg/cli(and tests) that concatenated or compared these constants as bare strings, using.String()orstring(...)conversions where the compiler now requires an explicit conversion.Scope
GhAwRootDir/TmpGhAwDirand their many derivedTmp*/*Expr/*Shellconstants 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