Repository navigation
Resolve package specification audit findings - #77455
Conversation
Co-authored-by: gh-aw-bot <[email protected]>
Co-authored-by: gh-aw-bot <[email protected]>
Co-authored-by: gh-aw-bot <[email protected]>
Co-authored-by: gh-aw-bot <[email protected]>
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
❌ PR Specification Reviewer failed to deliver outputs. Please review the logs for details. PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
This comment has been minimized.
This comment has been minimized.
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (256 added lines under 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify that the implementation matches the decision. 🔎 Evidence used
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Found two blocking correctness issues:
- Finding sorting is unstable for tied keys, so report output can be nondeterministic.
- The semver specification now codifies returning a fabricated
v-prefixed string for invalid input instead of preserving/rejecting invalid data.
The review was static; tests were not run per the review instructions.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
|
|
||
| // Sort orders findings by file, line, column, descending severity, and rule ID. | ||
| func Sort(findings []Finding) { | ||
| slices.SortFunc(findings, func(a, b Finding) int { |
There was a problem hiding this comment.
slices.SortFunc is not stable, so findings with identical file/line/column/severity/rule keys can be reordered based on input layout. That makes rendered reports and diffs nondeterministic even though this API is intended to provide canonical ordering. Please use slices.SortStableFunc or add a deterministic final tie-breaker (for example message/location data).
| }, | ||
| { | ||
| name: "adds prefix to invalid input", | ||
| input: "not-a-version", |
There was a problem hiding this comment.
This test promotes a malformed value (vnot-a-version) to the public contract. NormalizeGitDescribeSemver is used as a semantic-version normalizer, but prefixing arbitrary invalid input still leaves an invalid semver and can hide bad input from callers. Please preserve the prior documented behavior (return the trimmed input unchanged) or change the API to report invalid input explicitly, rather than locking in a fabricated version string.
There was a problem hiding this comment.
🟡 Changes recommended
The exported-symbol inventories still list function-local types and methods on private types as public APIs, advertising declarations that consumers cannot use.
4 open issues
What changed in this PR
This PR addresses the package specification audit in #77454 by aligning gh-aw’s documented APIs with implementation and clarifying console table behavior.
Changes:
- Implements
scanfindings.Sort,scanfindings.CountAtLeast, andintent.ResolveRisk, with specification tests. - Corrects package contracts and expands exported-symbol documentation.
- Makes table
omitemptyhide columns only when all rows contain zero values, with struct and array coverage.
| File | Description |
|---|---|
pkg/workqueue/README.md |
Documents additional ledger and policy types. |
pkg/workflow/README.md |
Removes a nonexistent API and expands declaration coverage. |
pkg/semverutil/spec_test.go |
Tests invalid-input normalization and removes a mismatch marker. |
pkg/semverutil/README.md |
Clarifies trimming and prefixing of invalid input. |
pkg/scanfindings/spec_test.go |
Tests sorting and severity-threshold counting. |
pkg/scanfindings/scanfindings.go |
Implements Sort and CountAtLeast. |
pkg/scanfindings/README.md |
Specifies descending severity ordering. |
pkg/intent/spec_test.go |
Tests explicit and derived risk classification. |
pkg/intent/resolver.go |
Implements ResolveRisk. |
pkg/console/spec_test.go |
Tests all-zero and mixed-value optional columns. |
pkg/console/render.go |
Filters empty columns and recognizes zero structs and arrays. |
pkg/console/render_test.go |
Adds struct and array zero-value cases. |
pkg/console/README.md |
Documents table-column omission behavior. |
pkg/connectors/README.md |
Expands declaration and execution API documentation. |
pkg/cli/README.md |
Expands report and analysis symbol documentation. |
pkg/actionpins/spec_test.go |
Removes the resolved container-mapping mismatch marker. |
pkg/actionpins/README.md |
Corrects container-mapping fields and digest requirements. |
Review effort: Balanced (dynamic)
| | Dry-run, durable sessions, and graders | `DryRunCompileReport`, `DryRunScannerCheck`, `DryRunScannerDifferential`, `DurableSessionReport`, `ValidationScriptLocation`, `RegradedRun`, `RegradeDefinition`, `RegradeOriginalEvidence`, `SecondaryMetricAnalysis`, `SecondaryMetricVariantAnalysis`, `OutcomeMetricCoverage`, `OutcomeWindowInfo` | Compilation and scanner-gate results, validated session restoration, grader evidence, secondary metrics, and outcome maturity coverage. | | ||
| | Episodes and failures | `EpisodeRoot`, `EpisodeCoverage`, `EpisodeHop`, `EpisodeHopEdge`, `EpisodeRunCost`, `EpisodeExplanation`, `EpisodeRetrievalIssue`, `EpisodeOutcomeObservation`, `EpisodeOutcomesData`, `EpisodeOutcomeMembershipCoverage`, `EpisodeOutcomeData`, `FailureSignal`, `FailureCluster`, `FailureRunIdentity`, `FailureClusterTarget`, `FailureInvestigation`, `FailureInvestigationTarget`, `FailureClusterStatistics` | Bounded workflow-invocation and failure-sample evidence; shared symptoms are not diagnoses, and selected runs are not presumed to exhaust an episode. | | ||
| | Model routing and usage | `AwInfoModelConfig`, `AwInfoModelConfigRouting`, `AwInfoModelSelection`, `AwInfoModelRouting`, `ModelEndpointMismatch`, `ModelRoutingLogsSummary`, `ModelRoutingRouteSummary`, `ModelRoutingLabels`, `ModelRoutingChoice`, `ModelRoutingFailure`, `ModelRoutingCost`, `ModelRoutingDeviation`, `ModelRoutingAgentCost`, `ModelRoutingSummary`, `AgentUsageBreakdown`, `AgentModelUsage`, `TokenUsageSteering`, `SteeringNotice` | Configured and observed model routes, endpoint compatibility, costs, failures, agent attribution, and steering notices. Detection traffic remains separate from agent usage. | | ||
| | Work-queue and cached-log reports | `WorkQueueCurrentSnapshot`, `WorkQueueAssignmentReceipt`, `WorkQueueClaimReceipt`, `WorkQueueFinishReceipt`, `WorkQueueDiagnostics`, `WorkQueueAssignedClaimDiagnostics`, `AppendAudit`, `AppendWorkflowRuns`, `AppendRateLimit` | Snapshot-based queue diagnostics and cache append operations; receipts describe validated facts, while append helpers update their corresponding cached report records. | |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd, /codebase-design, and /grill-with-docs. Requesting changes on a behavior change that is not covered by tests, plus two inaccurate README rows.
📋 Key Themes & Highlights
Key Themes
- Unintended scope in
omitempty:isZeroValuenow usesIsZero()forStruct. This also hides zero struct fields in single-struct rendering, not just table columns (confirmed by a probe at HEAD). - Unstable sort under a stable-ordering claim:
scanfindings.Sortusesslices.SortFunc, but the spec test documents stable ordering. - Inaccurate API docs:
DetailedHealthandRepositoryResponseare function-local types, so they are not package exports. - Undocumented semver behavior change:
NormalizeGitDescribeSemvernow prefixes invalid input withv. Only one caller, and it validates first.
Positive Highlights
- ✅ Clean, targeted spec tests added for each new public function.
- ✅
CountAtLeastandResolveRiskmatch their READMEs. - ✅ The regex in
actionpinsmatches the lowercase-hex digest documentation. - ✅ Targeted
go testruns on console, scanfindings, intent, semverutil, and actionpins all pass.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~11 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
|
|
||
| switch val.Kind() { | ||
| case reflect.Array, reflect.Map, reflect.Slice, reflect.String: | ||
| case reflect.Array, reflect.Struct: |
There was a problem hiding this comment.
[/tdd] Scope creep in isZeroValue: Struct now uses IsZero(), so a zero-valued struct field tagged console:"...,omitempty" is dropped even in single-struct rendering. On base, it was always rendered. I confirmed this with a probe: RenderStruct(row) with a zero Inner field no longer prints Inner.
💡 Suggested test
Add a case to spec_test.go that renders a single struct (not a slice) with a zero-valued omitempty struct field, and assert the intended output. If hiding is intended, document it in pkg/console/README.md. Otherwise limit the struct rule to table columns.
@copilot please address this.
|
|
||
| // Sort orders findings by file, line, column, descending severity, and rule ID. | ||
| func Sort(findings []Finding) { | ||
| slices.SortFunc(findings, func(a, b Finding) int { |
There was a problem hiding this comment.
[/tdd] slices.SortFunc is not stable, but TestSpec_PublicAPI_Sort (spec_test.go:150) documents "stable ordering". Findings that compare equal (same severity and location) can reorder between runs.
💡 Suggested fix
Use slices.SortStableFunc here, which matches the pkg/workflow and pkg/cli convention. Alternatively, drop the word "stable" from the test comment. Add a case with two equal-key findings to lock in the chosen behavior.
@copilot please address this.
| | Area | Exported symbols | Description | | ||
| |------|------------------|-------------| | ||
| | Audit and detection | `AuditComparisonRoute`, `AuditComparisonRouteDelta`, `AuditDecision`, `AuditDecisionQuestion`, `AuditHarnessRoutingOutcome`, `AuditModelCatalog`, `AuditModelCatalogEndpoint`, `AuditCatalogModel`, `AuditRetrySummary`, `AuditEngineRetry`, `AuditRetryAttempt`, `AuditEvidenceSearch`, `AuditEvidenceMatch`, `AuditEvidenceExcerpt`, `AuditEvidenceRef`, `AuditEvidenceNativeRef`, `DetectionModelUsage`, `EvalsSummary`, `ObsoletePREvidence` | Structured audit comparisons, advisory decisions, model and retry observations, query-specific evidence, detection traffic, and PR lifecycle evidence. These records do not establish completeness, authorization, or root cause. | | ||
| | Doctor and health | `DoctorAgentAssignmentCheck`, `DoctorAssignmentRunHistory`, `DoctorAssignmentRunEvidence`, `DoctorTokenValidation`, `DoctorReleaseCheck`, `DoctorCompiledWorkflowCheck`, `DetailedHealth`, `HealthApprovalEvidence`, `HealthCacheEvidence`, `HealthCollection`, `HealthDetectionFailure`, `HealthDurableRun`, `HealthDurableSessions`, `HealthPotentialIssue`, `HealthJobEvidence`, `HealthPRLifecycleEvidence`, `HealthRevisionCohort`, `HealthRevisionStatus`, `HealthSubagentFailure`, `HealthWorkQueue` | Bounded repository, run, cache, revision, durable-session, and work-queue observations used by doctor and health reports. | |
There was a problem hiding this comment.
[/grill-with-docs] DetailedHealth is declared inside a function (pkg/cli/health_command.go:277), so it is not a package-level export. Listing it under the public API table is inaccurate. Remove it, or move the type to package scope if it is meant to be public.
@copilot please address this.
| | Connector declarations and credentials | `DevelopmentConnector`, `LoadDevelopmentConnector`, `ConnectorWebhookSource`, `ConnectorGitHubApp`, `ConnectorToken`, `ConnectorGitHubOIDC`, `ConnectorOperationOptions`, `ConnectorRegistration`, `WorkflowConnector` | Compiler-resolved connector declarations, source policy, credential adapters, and workflow-owned operation controls. Selection remains phase-scoped. | | ||
| | Durable and engine helpers | `DurableExecutionProvider`, `GetDurableExecutionPlan`, `GetInternalLogsDir`, `GetPluginInstallationSteps`, `GetLogParserScriptSource`, `GetPostConfigPluginInstallationSteps`, `EngineDurableDefinition`, `DurableConfig`, `DurableExecutionPlan`, `DurableRestoreStepName`, `PiSessionDirectory`, `DynamicWorkflowsEnabled`, `ResolveEffectiveEngineConfig` | Engine capabilities and helpers for durable execution, plugin setup, log capture, session restoration, and resolving effective engine configuration. | | ||
| | Compiler controls | `SetSkipDefaultCheckout`, `SetDefaultPushToken`, `SetDynamicPushToken`, `SetRequireSelfHostedRunners`, `SetLockFileLogo`, `DefaultModelRoutingWorkflowCount`, `IsNoEmit`, `SetReadOnly`, `SetDryRun`, `SetEnvironmentOverride`, `IncrementExperimentalWarningCount`, `GetExperimentalWarningCount`, `SetConfiguredModelValidator` | Compiler mutators and accessors for checkout credentials, runner requirements, output mode, environment overrides, dry-run state, and optional model validation. | | ||
| | Grader and security configuration | `BuiltinGraderRegistry`, `BuiltinGraderIDs`, `HasGraders`, `EnabledGraderIDs`, `CustomGraderIDs`, `DefaultGraderIDs`, `PrepareShellScript`, `AddSecurityAdvisoryCommentConfig`, `CreateSecurityAdvisoryConfig`, `ContentsIsNone`, `RepoProtectedFilesConfig`, `RepositoryResponse`, `TokenBrokerConfig`, `IsReportAsIssueEnabled`, `IsLockFileLogoEnabled` | Grader registry and selection helpers, security safe-output configuration, protected-file settings, token-broker selection, and permission or reporting checks. | |
There was a problem hiding this comment.
[/grill-with-docs] RepositoryResponse is declared inside a function (pkg/workflow/repository_features_validation.go:402), so it is not a package-level export. Remove it from this table, the same as DetailedHealth in pkg/cli/README.md.
@copilot please address this.
| @@ -100,13 +100,14 @@ semverutil.IsMorePreciseVersion("v4.3.0", "v4.3.0") // false (equal precision) | |||
|
|
|||
| ### `NormalizeGitDescribeSemver(v string) string` | |||
There was a problem hiding this comment.
[/codebase-design] This documents a behavior change, not a spec fix. Previously invalid input was returned unchanged. Now NormalizeGitDescribeSemver calls EnsureVPrefix before validating, so "foo" returns "vfoo". The only caller (pkg/cli/add_package_manifest_parse.go:117) validates first, so it is safe. Call the change out in the PR description, and say the function is a prefixer rather than a validator.
@copilot please address this.
| } | ||
|
|
||
| // ResolveRisk returns the explicit risk when set, otherwise derives it from the | ||
| // record's domains and priority. |
There was a problem hiding this comment.
[/tdd] Confirm the "unknown" default for empty input is intended. ResolveRisk only elevates to critical for security domain with Priority == "critical", and the README matches that. Add one spec case for empty input and one for a non-security critical priority, so the boundary is locked in.
@copilot please address this.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "ac3b4a4f9283cf9c2fc4ac7138396a6ad80e5ea5",
"kind": "requested",
"schema_version": "1",
"state": "d5a02f57ffa5540942e25d5aa2206c0c8d6e2813108f34a12bc55dc2663adcdd",
"work": [
"50cd3bd8f08ad72c4fd875fbd8400854c3037be036038653166e665a222b46fa",
"855a32874ec54a010aef6b91246d683d1560500251feb17fa33e7b90736e08c2",
"9f2e0c595b7a79adb55fa7a9a5502507f212ffe29af602899eef3f7fbc39ce56",
"ba5e90f030d72b2e49e26c965dcc3c291b71eb217a98d23a5591e8c049a98a30",
"bc2589a6e0c13e5f46ea18546bfe8ab01617c4e2e16f9172cdc15faa335f9ae6",
"da02b26982c297d46e7ca567b544cd0da05cab596a8e12a755f167025ee918d7",
"de97483a274a5a8b31c04f33f87ae0e12f498e072d13c05307c69c06765ee643",
"ee9de9376927fc0b23658b1dcd21dce91037da3965de6e3ead75bb77d35cd69a"
],
"workflow": "pr-sous-chef"
}
|
…n-audit-resolution Co-authored-by: gh-aw-bot <[email protected]>
Co-authored-by: gh-aw-bot <[email protected]>
Triage summary
|
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "cb2f864a56f0db62127b2e162e223fb54962c17e",
"kind": "requested",
"schema_version": "1",
"state": "260cc8e232ce3ba02f2381328465c0b270c17075b30fd45cd08a7fe52919b313",
"work": [
"50cd3bd8f08ad72c4fd875fbd8400854c3037be036038653166e665a222b46fa",
"855a32874ec54a010aef6b91246d683d1560500251feb17fa33e7b90736e08c2",
"9f2e0c595b7a79adb55fa7a9a5502507f212ffe29af602899eef3f7fbc39ce56",
"ba5e90f030d72b2e49e26c965dcc3c291b71eb217a98d23a5591e8c049a98a30",
"bc2589a6e0c13e5f46ea18546bfe8ab01617c4e2e16f9172cdc15faa335f9ae6",
"da02b26982c297d46e7ca567b544cd0da05cab596a8e12a755f167025ee918d7",
"de97483a274a5a8b31c04f33f87ae0e12f498e072d13c05307c69c06765ee643",
"ee9de9376927fc0b23658b1dcd21dce91037da3965de6e3ead75bb77d35cd69a"
],
"workflow": "pr-sous-chef"
}
|
|
🎉 This pull request is included in a new release. Release: |

The audit found missing APIs, inaccurate package contracts, and incomplete exported-symbol documentation. This change aligns implementation and specs across the affected packages.
scanfindings.Sort,scanfindings.CountAtLeast, andintent.ResolveRisk; remove the phantomworkflow.SanitizeIdentifierreference.actionpinsandsemverutilbehavior descriptions, remove stale mismatch markers, and document exports incli,workflow,connectors, andworkqueue.omitemptyto hide a column only when every row’s value is zero, including nested structs and arrays.The
optionalcolumn remains when any row has a non-zero value; it is omitted when all rows are zero-valued.