Repository navigation
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
✅ Test Quality Sentinel completed test quality analysis.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ 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. The No-op messageLean already. Ship.
|
|
✅ PR Specification Reviewer completed successfully! 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. The No-op messageReviewed PR #80766 at head d3f6d64; no applicable normative specification contract was identified, so no review or specification update was needed.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
This comment has been minimized.
This comment has been minimized.
Comment MemoryPeek at saved memory (spec-review-history)History |
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 issues in the new analyzer:
- The substring heuristic produces broad false positives for ordinary identifiers and strings (for example,
author,monkey, andblock). - The analyzer testdata contains an unannotated matching call in
example_test.go, which causes an unexpected diagnostic underanalysistest.Run.
Please address both before merge.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.7K
Comment /review to run again
| ) | ||
|
|
||
| func testFile(data []byte) { | ||
| os.WriteFile("secret", data, constants.FilePermPublic) |
There was a problem hiding this comment.
This call matches the analyzer but has no // want annotation. analysistest.Run loads the package testdata, so this fixture produces an unexpected diagnostic and makes the analyzer test fail. Add the expected diagnostic (or move this case to a fixture that is intentionally excluded).
There was a problem hiding this comment.
_test.go fixtures are intentionally skipped by filecheck.ShouldSkipFilename, so this case should remain unannotated. I removed the incorrect expected diagnostic and verified the analyzer test passes (d0bf127).
| ast.Inspect(expr, func(n ast.Node) bool { | ||
| if found || n == nil { | ||
| return false | ||
| } |
There was a problem hiding this comment.
The substring test makes this analyzer report many ordinary names as sensitive: key matches monkey/keyboard, auth matches author, and lock matches block/clock. Because this linter is registered globally, these false positives will make its deferred enforcement noisy and can hide the real findings. Please tokenize identifiers/strings or otherwise require term boundaries before enabling it.
There was a problem hiding this comment.
Replaced substring checks with whole-word matching over camelCase and punctuation-delimited segments, and added false-positive fixtures (monkey, author, environment, tokenizer). Fixed in d0bf127.
🏗️ Design Decision Gate — ADR RequiredThis PR adds significant business logic (211 new 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
📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in References: §45459078390
|
Comment MemoryPeek at saved memory (review-history)History |
🧪 Test Quality Sentinel Report✅ Test Quality Score: 100/100 — Excellent
📊 Metrics (1 test)
🔎 Review notes
Build tag on Execution: the sandbox denied Verdict
|
There was a problem hiding this comment.
✅ Test Quality Sentinel: 100/100. 0% implementation tests (threshold: 30%). No guideline violations. Note: sandbox denied go test, so this review is static.
🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 7.4K
Comment /review to run again
There was a problem hiding this comment.
Reviewed with /tdd and /codebase-design. The analyzer is cleanly structured: it reuses the internal/ helpers, registers and documents the new analyzer, and its fixtures cover aliases, dot imports, suppressions, and generated files. The package tests and pkg/linters tests pass locally.
Main concern (inline): containsSensitive uses raw substring matching. lock already matches production lockFile writes in pkg/workflow/compiler.go and pkg/workflow/maintenance_workflow.go, and auth, env, and key match common words. Since CI enforcement is deferred, this is non-blocking now, but segment-based matching should land before enforcement is enabled.
Limits of this review
I could not read the lock-file churn (71 files) because the partial clone cannot fetch the base commit. I also could not run the analyzer over all of pkg/ because the full go vet build was killed for memory. The heuristic findings count therefore comes from the grep scan, not from the analyzer itself.
@copilot please address the inline comments before enabling enforcement.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~2 AIC · ⊞ 5.1K
Comment /matt to run again
| match := func(s string) bool { | ||
| s = strings.ToLower(s) | ||
| for _, term := range terms { | ||
| if strings.Contains(s, term) { |
There was a problem hiding this comment.
[/tdd] containsSensitive matches terms as raw substrings, so common words trip the check: auth matches author, env matches environment, key matches keyword, and token matches tokenizer. The lock term is the worst case. It matches the lockFile path already used in production at pkg/workflow/compiler.go:376 and pkg/workflow/maintenance_workflow.go:631, which write .lock.yml workflow files rather than secrets. Suggested fix: match whole identifier segments instead of substrings (split camelCase and separators such as _, -, ., and /, and list plurals like credentials explicitly), and narrow or drop lock. @copilot please address this.
There was a problem hiding this comment.
Sensitive terms are now matched as whole segments, plurals are included, and lock was dropped. The README and fixtures reflect the narrower heuristic. Fixed in d0bf127.
| files.OpenFile(authPath, files.O_CREATE|files.O_WRONLY, c.FilePermPublic) // want "os.OpenFile uses FilePermPublic" | ||
| files.MkdirAll("secret-dir", c.FilePermPublic) // want "restricted directory mode" | ||
|
|
||
| files.WriteFile(publicName, data, c.FilePermPublic) |
There was a problem hiding this comment.
[/tdd] The fixture has no non-flagged cases for the substring false positives above. Add calls such as files.WriteFile(authorName, data, c.FilePermPublic) and files.WriteFile("environment.txt", data, c.FilePermPublic) to the negative block, plus a lockFile case if lock is kept. This pins the segment-matching fix with tests that fail before the change. @copilot please address this.
There was a problem hiding this comment.
Added negative fixtures for authorName, environment.txt, tokenizer.txt, and lockFile, plus a call through LookupEnv to verify function names are ignored. Fixed in 4176f2a.
There was a problem hiding this comment.
🟡 Changes recommended
The analyzer can fail the mandatory progress gate on existing intentional public writes, while permission-detection errors and an unrelated Claude Code rollback remain unresolved.
5 open issues
Keep unaudited analyzer out of the mandatory lint gate · New Restore workflow locks to their previous runtime pins · New Ignore non-creating OpenFile calls · New Detect world-accessible modes in converted and compound expressions · New Avoid false positives from lockFile and function identifiers · New
What changed in this PR
Adds writefilepublicpermsensitive to gh-aw’s custom Go analyzer suite to flag potentially sensitive files created with public permissions, addressing #80765.
Changes:
- Detects sensitive terms in paths and content for
os.WriteFile,os.OpenFile, andos.MkdirAll. - Adds fixtures, registration, and synchronized documentation; explicit CI enforcement remains deferred.
- Separately rolls back Claude Code from
2.1.331to2.1.325in 29 generated workflow locks.
| File | Description |
|---|---|
pkg/linters/writefilepublicpermsensitive/writefilepublicpermsensitive.go |
Implements permission and sensitivity detection. |
pkg/linters/writefilepublicpermsensitive/writefilepublicpermsensitive_test.go |
Runs analyzer fixture tests. |
pkg/linters/writefilepublicpermsensitive/testdata/src/github.com/github/gh-aw/pkg/constants/constants.go |
Provides permission constants for fixtures. |
pkg/linters/writefilepublicpermsensitive/testdata/src/example/other/other.go |
Provides unrelated symbols for negative cases. |
pkg/linters/writefilepublicpermsensitive/testdata/src/example/generated.go |
Covers generated-file exclusion. |
pkg/linters/writefilepublicpermsensitive/testdata/src/example/example.go |
Covers matching, non-matching, and suppressed calls. |
pkg/linters/writefilepublicpermsensitive/testdata/src/example/example_test.go |
Covers test-file exclusion. |
pkg/linters/writefilepublicpermsensitive/testdata/src/example/dot.go |
Covers dot imports and parentheses. |
pkg/linters/spec_test.go |
Adds analyzer to documentation contract tests. |
pkg/linters/registry.go |
Registers the analyzer. |
pkg/linters/README.md |
Documents detection behavior and limitations. |
pkg/linters/doc.go |
Updates analyzer inventory comments. |
pkg/linters/doc_sync_test.go |
Records deferred CI enforcement. |
.github/workflows/step-name-alignment.lock.yml |
Rolls back Claude runtime and metadata. |
.github/workflows/static-analysis-report.lock.yml |
Rolls back Claude runtime and metadata. |
.github/workflows/smoke-claude-sub-agents.lock.yml |
Rolls back sub-agent smoke-test runtime. |
.github/workflows/smoke-claude-routed.lock.yml |
Rolls back routed smoke-test runtime. |
.github/workflows/smoke-claude-routed-anthropic.lock.yml |
Rolls back both Claude installations. |
.github/workflows/smoke-claude-dynamic.lock.yml |
Rolls back both Claude installations. |
.github/workflows/smoke-claude-copilot.lock.yml |
Rolls back Claude/Copilot smoke-test runtime. |
.github/workflows/smoke-claude-copilot-auto.lock.yml |
Rolls back Claude/Copilot auto-test runtime. |
.github/workflows/smoke-claude-auto.lock.yml |
Rolls back Claude auto-test runtime. |
.github/workflows/semantic-function-refactor.lock.yml |
Rolls back refactoring-agent runtime. |
.github/workflows/safe-output-health.lock.yml |
Rolls back health-monitor runtime. |
.github/workflows/refiner.lock.yml |
Rolls back code-refiner runtime. |
.github/workflows/org-health-report.lock.yml |
Rolls back organization-report runtime. |
.github/workflows/lockfile-stats.lock.yml |
Rolls back statistics-agent runtime. |
.github/workflows/instructions-janitor.lock.yml |
Rolls back instructions-janitor runtime. |
.github/workflows/go-logger.lock.yml |
Rolls back logger-agent runtime. |
.github/workflows/github-mcp-tools-report.lock.yml |
Rolls back tools-report runtime. |
.github/workflows/example-workflow-analyzer.lock.yml |
Rolls back workflow-analysis runtime. |
.github/workflows/engine-conformance-claude.lock.yml |
Rolls back Claude conformance-test runtime. |
.github/workflows/deployment-incident-monitor.lock.yml |
Rolls back incident-monitor runtime. |
.github/workflows/delight.lock.yml |
Rolls back Delight-agent runtime. |
.github/workflows/daily-vulnhunter-scan.lock.yml |
Rolls back vulnerability-scan runtime. |
.github/workflows/daily-safeoutputs-git-simulator.lock.yml |
Rolls back Git-simulator runtime. |
.github/workflows/daily-safe-outputs-conformance.lock.yml |
Rolls back safe-output conformance runtime. |
.github/workflows/daily-grader-audit.lock.yml |
Rolls back grader-audit runtime. |
.github/workflows/daily-elixir-credo-snippet-audit.lock.yml |
Rolls back Elixir-audit runtime. |
.github/workflows/daily-choice-test.lock.yml |
Rolls back both Claude installations. |
.github/workflows/daily-byok-ollama-test.lock.yml |
Rolls back Claude threat-detection runtime. |
.github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml |
Rolls back spellcheck-agent runtime. |
Review effort: Max (adaptive)
| walkfuncerrshadow.Analyzer, | ||
| wgdonenotdeferred.Analyzer, | ||
| writebytestring.Analyzer, | ||
| writefilepublicpermsensitive.Analyzer, |
There was a problem hiding this comment.
The default make golint-custom flags now disable this unaudited heuristic; it remains registered and can be opted into explicitly. The final progress gate passed. Fixed in 4176f2a.
| run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.29.20 --rootless | ||
| - name: Install Claude Code CLI | ||
| run: npm install -g @anthropic-ai/claude-code@2.1.331 | ||
| run: npm install -g @anthropic-ai/claude-code@2.1.325 |
There was a problem hiding this comment.
The branch is merged with latest main, and the current PR diff contains no workflow-lock changes, so no Claude runtime rollback remains to restore (03b8bb0).
| if len(call.Args) != modeIndex+1 || !isPublicPerm(pass, call.Args[modeIndex]) { //nolint:uncheckedsliceindex // modeIndex is 1 or 2 and the argument count is checked | ||
| return | ||
| } | ||
| sensitive := containsSensitive(pass, call.Args[0]) //nolint:uncheckedsliceindex // the argument count is checked above |
There was a problem hiding this comment.
os.OpenFile now skips known constant flags without O_CREATE, while unknown flags remain conservatively checked. Added negative fixtures for O_RDONLY and zero flags. Fixed in 4176f2a.
| func isPublicPerm(pass *analysis.Pass, expr ast.Expr) bool { | ||
| var ident *ast.Ident | ||
| switch expr := astutil.UnwrapParenExpr(expr).(type) { | ||
| case *ast.Ident: | ||
| ident = expr | ||
| case *ast.SelectorExpr: | ||
| ident = expr.Sel | ||
| default: | ||
| return false | ||
| } | ||
| obj, ok := pass.TypesInfo.ObjectOf(ident).(*types.Const) | ||
| return ok && obj.Name() == "FilePermPublic" && obj.Pkg() != nil && obj.Pkg().Path() == "github.com/github/gh-aw/pkg/constants" | ||
| } |
There was a problem hiding this comment.
Permission expressions are now resolved for references to FilePermPublic and their final constant mode is checked. Added conversion, OR, and restrictive-mask fixtures. Fixed in 4176f2a.
| match := func(s string) bool { | ||
| s = strings.ToLower(s) | ||
| for _, term := range terms { | ||
| if strings.Contains(s, term) { |
There was a problem hiding this comment.
Word-boundary matching now excludes ordinary lockFile/author names, selector names, and call identifiers. README and negative fixtures are updated. Fixed in d0bf127.
|
🛠️ Agentic Maintenance updated this pull request branch. |
|
🍳 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": "cf48fcb27fa4e0172364d49958bb602d5ea64bba",
"kind": "requested",
"schema_version": "1",
"state": "4f4c6d039338fe53dc5fd4b8ffa30d720614f6df61efe302c4e15d62d5c51f0a",
"work": [
"2511b2301ec3e2fbe5318a68f6e7bee2dd705bcaafb4919292e97ffc4b644ddd",
"2e6aa1440aa9d5539b8e3b5113e9eb38ef274100b5792f0b2c5b8abfaf64360a",
"864031d4a3bae9a2feff3d3fb7638b3d5b67fd5f440be4743ac9dd2ef9372aef",
"982e84437f5c87f85b75e8e7d5f2191fd456df9646f233c414d0072e4843594d",
"b09c2e2f3943f47d07a76fc7f309b21b1e925753e266d39fe86b62fc68534e3e",
"c034133635eaf929b621ee1806424bdbb762b7c20dce7c5d815318364cb22140",
"cfb6579425ef78c2ca979e6607d7c637c3f05f44e28aecfdf05219d4cff493e5",
"e0e839b2c582a2c87d33ef2e8893d4dda8c67e025c18c16a03918541a82d03c5",
"f43815d6f7e695ee4bf51d51b3380f99b413ce3a4121ebfd8ea16478de6fd531"
],
"workflow": "pr-sous-chef"
}
|
…ritefilepublicperm-sensitive-80a56ecc Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>


FilePermPublicmakes files world-readable, including files whose paths or content may indicate sensitive data. This change adds an analyzer to flag those uses for review.os.WriteFile,os.OpenFile, andos.MkdirAllcalls usingFilePermPublicfor sensitive terms in path or content expressions.writefilepublicpermsensitive; CI enforcement remains deferred pending review of heuristic findings.