[repository-quality] 🎯 Repository Quality Improvement Report - CLI Sibling-Command Flag & Safety-Guard Parity Gaps (2026-09-25) #63445
Closed
Replies: 1 comment
|
This discussion was automatically closed because it expired on 2026-09-26T13:12:38.294Z.
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
🎯 Repository Quality Improvement Report - CLI Sibling-Command Flag & Safety-Guard Parity Gaps
Analysis Date: 2026-09-25
Focus Area: CLI Sibling-Command Flag & Safety-Guard Parity Gaps
Strategy Type: Custom
Custom Area: Yes — ADR-45573 (2026-07-15) documented and fixed four flag-parity gaps between
compile/validate/update/upgrade(adding--engine/--repotoupgradeand--approvetoupdate), and explicitly deferred one gap (--no-security-scanneroncompile/validate) as "intentionally skipped... because those commands operate exclusively on local files where the scanner is a no-op." This run re-audited the four commands post-fix and found the ADR's own scope was incomplete:upgradeinternally invokes the exact same security-scan-enforcing compile/update pipeline asupdate, but never registered the escape hatchupdatehas (--no-security-scanner), creating a real (not hypothetical) parity gap the ADR missed. Combined with 3 verified stale file-path references in.github/skills/, this is a two-pronged consistency-debt area: CLI surface parity and skill-documentation path accuracy.Executive Summary
ADR-45573 fixed three of four identified flag-consistency gaps between the
compile,validate,update, andupgradecommands, but its "F3" deferral reasoning — that--no-security-scanneris a no-op oncompile/validatebecause they operate on local files only — does not extend toupgrade. Tracingupgrade's Step 4 compile call (compileWorkflowsForUpdate→ sharedCompileWorkflowspipeline,pkg/cli/upgrade_command.go:347-368) confirmsupgradeshares the same enforcement code path asupdate's manifest-managed-workflow rewrite (pkg/cli/update_manifest.go:582-585,629-632), whereScanMarkdownSecurityfindings hard-fail with the exact message "...or pass --no-security-scanner to skip this check" — a flag that does not exist onupgrade. Any CI pipeline runninggh aw upgradeon a workflow whose upstream manifest source content trips a security-scan finding has no way to bypass it short of falling back toupdateor manual editing, reproducing the exact UX problem ADR-45573 was written to solve, just for a flag the ADR didn't audit.Separately, a targeted repo-relative path audit of
.github/skills/*/SKILL.mdfiles found 3 confirmed-broken references:awf-release-integratorpoints at nonexistentdocs/awf-config-spec.md/docs/awf-config.schema.json(the real schema lives atpkg/workflow/schemas/awf-config.schema.json; the spec lives atspecs/awf-config-sources-spec.md),otel-queriespoints at adocs/src/content/docs/guides/custom-otlp-attributes.mdthat was never created, andmessagesstill tells contributors to editpkg/workflow/safe_outputs.go, a file that was split into 40+safe_outputs_*.gofiles (confirmed viafind) with no single-file successor of that name.Recommended actions: (1) add
--no-security-scannertoupgradeand thread it through tocompileWorkflowsForUpdate/the manifest-update call sites it triggers, matchingupdate's existing wiring; (2) add a lightweight CI-gated consistency test enumerating flags across the four sibling commands so gaps like this are caught automatically rather than requiring manual re-audits (ADR-45573 already added some tests for the 3 flags it fixed, but nothing generalized); (3) fix the 3 stale skill path references identified above.Full Analysis Report
Focus Area: CLI Sibling-Command Flag & Safety-Guard Parity Gaps
Current State Assessment
Metrics Collected:
upgradehas--no-security-scannerflagpkg/cli/upgrade_command.go)updatehas--no-security-scannerflagpkg/cli/update_command.go:177)upgradeshares compile/security-scan pipeline withupdateCompileWorkflows/compileWorkflowsForUpdateupgrade/--no-security-scannerFindings
Strengths
--engine/--repoonupgrade,--approveonupdate) are correctly wired and covered by unit tests.ScanMarkdownSecurity) is consistently applied acrossadd,add-wizard,deploy,trial, andupdate—upgradeis the sole omission found.DisableSecurityScannerplumbing (pkg/cli/flags.go:42-47,resolveDeprecatedBoolFlag) is a reusable, already-tested pattern — wiringupgradeis a small, low-risk change.Areas for Improvement
gh aw upgradecannot bypass a security-scan hard-failure thatgh aw updatecan, despite running through the identical enforcement code (update_manifest.go:582-585,629-632) via the shared compile pipeline. This silently blocks CI upgrade automation with no documented workaround other than switching commands.compile/validate/update/upgrade; ADR-45573's fix required manual discovery and will silently regress as new flags are added to one sibling but not others.awf-release-integrator,otel-queries,messages) reference nonexistent files, actively misdirecting future agent runs that follow those skills.Detailed Analysis
1. The
upgrade/--no-security-scannergappkg/cli/upgrade_command.goStep 4 (lines 347-368) callscompileWorkflowsForUpdate(opts.ctx, nil, opts.workflowDir, opts.engineOverride, opts.verbose, opts.approve), which (perpkg/cli/update_compile.go:28-44) is explicitly documented as using "the same configuration and orchestration as the compile command." This is the identical functionupdate_command.gocalls afterupdate_manifest.go's manifest-workflow-rewrite path enforcesScanMarkdownSecurity(lines 582, 629).upgrade_command.goregisters--engine,--repo,--approve,--org,--repos,--create-issue,--yes,--audit,--pre-releases,--no-fix,--no-actions,--no-compile,--disable-codemod,--create-pull-request/--pr— but never--no-security-scanner/--disable-security-scanner, which is present onadd,add-wizard,deploy,trial, andupdate.Because
opts.approveonly bypasses strict-mode manifest enforcement (new secrets/actions), not the separateScanMarkdownSecurityfindings check,--approveis not a substitute — a workflow tripping a security-scan finding duringupgradehas no flag-based escape hatch at all today.2. Missing flag-parity regression guard
ADR-45573's "Consequences" section notes: "Flag coverage is verified by new unit tests for registration, description consistency, and mutual exclusion" — but these tests target only the 3 flags fixed in that ADR, not a generalized cross-command flag inventory. A single parametrized test comparing the flag sets of
compile,validate,update,upgrade(with an explicit allowlist for intentional command-specific flags) would have caught this gap immediately and will prevent future ones from requiring a full manual re-audit like this one.3. Stale skill path references
.github/skills/awf-release-integrator/SKILL.md:32-33docs/awf-config-spec.md,docs/awf-config.schema.jsonspecs/awf-config-sources-spec.md,pkg/workflow/schemas/awf-config.schema.json.github/skills/otel-queries/SKILL.md:273docs/src/content/docs/guides/custom-otlp-attributes.mddocs/; reference should be removed or the guide created.github/skills/messages/SKILL.md:68pkg/workflow/safe_outputs.gopkg/workflow/safe_outputs_*.gofiles; closest match for "parser" ispkg/workflow/safe_outputs_parser.go🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: Split the following tasks into individual work items.
Improvement Tasks
Task 1: Add
--no-security-scannerflag togh aw upgradePriority: High
Estimated Effort: Small
Focus Area: CLI Sibling-Command Flag Parity
Description:
gh aw upgraderuns through the same compile/security-scan-enforcing pipeline asgh aw update(viacompileWorkflowsForUpdate), but lacks the--no-security-scannerflag thatupdate(andadd,add-wizard,deploy,trial) already expose viaaddSecurityScannerFlag/resolveDeprecatedBoolFlag. Add the flag toupgrade_command.go, thread the resolved bool value through to the relevant compile/manifest-update call sites triggered byupgrade, and updatedocs/src/content/docs/setup/cli.mdaccordingly (matching how ADR-45573 documented its 3 flag additions).Acceptance Criteria:
cmd.Flags()inpkg/cli/upgrade_command.goregisters--no-security-scanner(and deprecated--disable-security-scanneralias) using the existingaddSecurityScannerFlaghelper frompkg/cli/flags.goupgradetriggers, soScanMarkdownSecurityfindings can be bypassed identically toupdatedocs/src/content/docs/setup/cli.mddocuments the new flag onupgrade--engine/--repo/--approve)Code Region:
pkg/cli/upgrade_command.go(flag registration +runUpgradeCommand),pkg/cli/flags.go(addSecurityScannerFlag)Task 2: Add a cross-command flag-parity regression test
Priority: Medium
Estimated Effort: Medium
Focus Area: CLI Sibling-Command Flag Parity
Description: ADR-45573 fixed a set of flag gaps found by manual audit, but no automated test guards against the same class of drift recurring (as this run's finding demonstrates it already has, for
--no-security-scanneronupgrade). Add a test that enumerates the registered flags oncompile,validate,update, andupgrade, and asserts a documented, explicit allowlist for any command-specific flags — flagging any new asymmetric flag addition as a failure requiring either symmetric rollout or an allowlist update.Acceptance Criteria:
pkg/cli/flag_parity_test.go) walks the flag sets ofcompile,validate,update,upgradecobra commands--no-security-scannerdeliberately absent fromcompile/validateper ADR-45573's F3 rationale)Code Region:
pkg/cli/flags_test.go, newpkg/cli/flag_parity_test.goTask 3: Fix stale file-path references in
awf-release-integratorandotel-queriesskillsPriority: Medium
Estimated Effort: Small
Focus Area: Skill Documentation Accuracy
Description:
.github/skills/awf-release-integrator/SKILL.mdreferencesdocs/awf-config-spec.mdanddocs/awf-config.schema.json, neither of which exists; the real files arespecs/awf-config-sources-spec.mdandpkg/workflow/schemas/awf-config.schema.json..github/skills/otel-queries/SKILL.mdreferencesdocs/src/content/docs/guides/custom-otlp-attributes.md, which was never created anywhere underdocs/. Update both skills to reference the correct existing paths (or remove the otel-queries line if no replacement guide is planned).Acceptance Criteria:
awf-release-integrator/SKILL.mdlines 32-33 updated tospecs/awf-config-sources-spec.mdandpkg/workflow/schemas/awf-config.schema.jsonotel-queries/SKILL.mdline 273 either removed or updated to point at an actual existing doc (verify no in-repo replacement exists before removing)grepre-verification confirms no remaining reference to the removed/renamed paths in either skill fileCode Region:
.github/skills/awf-release-integrator/SKILL.md,.github/skills/otel-queries/SKILL.mdIn .github/skills/awf-release-integrator/SKILL.md, replace the broken references to docs/awf-config-spec.md and docs/awf-config.schema.json (lines ~32-33) with the correct existing paths: specs/awf-config-sources-spec.md and pkg/workflow/schemas/awf-config.schema.json respectively. In .github/skills/otel-queries/SKILL.md, remove or fix the reference (around line 273) to docs/src/content/docs/guides/custom-otlp-attributes.md, which does not exist anywhere in the docs/ tree — verify first whether an equivalent guide exists under a different name before deciding whether to delete the line or repoint it. After editing, grep the repo to confirm no other skill or doc still references the old broken paths.Task 4: Fix stale
pkg/workflow/safe_outputs.goreference inmessagesskillPriority: Low
Estimated Effort: Small
Focus Area: Skill Documentation Accuracy
Description:
.github/skills/messages/SKILL.md(line 68) instructs contributors to "update the workflow parser inpkg/workflow/safe_outputs.go" for custom message-parsing logic, but this file no longer exists — it was decomposed into 40+ files (pkg/workflow/safe_outputs_parser.go,safe_outputs_config_base.go,safe_outputs_handler_registry*.go, etc.) as part of the repo's ongoing large-file decomposition effort (see 2026-08-24 focus-area history). Update the reference to point at the correct current file(s) for message parsing logic.Acceptance Criteria:
.github/skills/messages/SKILL.mdno longer references the nonexistentpkg/workflow/safe_outputs.gosafe_outputs_*.gofiles (most likelysafe_outputs_parser.goand/orsafe_outputs_config_base.go) actually contains the reflection-based parser and custom-parsing-logic hook described in that sentenceCode Region:
.github/skills/messages/SKILL.md,pkg/workflow/safe_outputs_parser.go📊 Historical Context
Previous Focus Areas
🎯 Recommendations
Immediate Actions (This Week)
--no-security-scannertogh aw upgrade(Task 1) — Priority: HighShort-term Actions (This Month)
.github/skills/*/SKILL.mdfor repo-relative path references and verifies they resolve, run in CI, to prevent this class of drift recurring (as it has 3 times now acrossmessages,javascript-refactoring,error-pattern-safety,temporary-id-safe-output,awf-release-integrator, andotel-queriesper this and prior runs)Long-term Actions (This Quarter)
add,add-wizard,deploy, andtrialas a fifth sibling-group, since they also shareDisableSecurityScanner/compile-adjacent logic and may harbor similar undetected asymmetries — Priority: Low📈 Success Metrics
upgrade/updateflag parity: 1 known gap (--no-security-scanner) → 0 gapsNext Steps
add/add-wizard/deploy/trialGenerated by Repository Quality Improvement Agent
Next analysis: 2026-09-26 — Focus area selected by diversity algorithm
All reactions