Skip to content

fix: precompute Daily File Diet source metrics - #71161

Merged
pelikhan merged 1 commit into
mainfrom
pelikhan-sturdy-funicular
Oct 22, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pelikhan-sturdy-funicular

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Summary

Fix the Daily File Diet missing-tool failure observed in run 39781997070.

  • Prepare deterministic largest non-test Go file and paired-test line counts before agent execution, without following symlinks.
  • Replace the brittle find -exec shell grant with an exact read of the prepared metrics packet; keep restricted shell permissions, Serena, credentials and output limits unchanged.
  • Require a real noop safe output for healthy files, and report missing metrics rather than guessing or retrying shell discovery.
  • Add regression coverage for 799/800/801 lines, recursive discovery, deterministic ties, test/text exclusion, symlinks, missing tests and empty/missing source directories.

Validation

  • make recompile — all 346 workflows compiled.
  • make fmt-cjs && make lint-cjs — passed (existing warnings only).
  • npm exec -- vitest run workflow_tool_policy_alignment.test.cjs — 19 passed.
  • ./gh-aw compile daily-file-diet --no-check-update --schedule-seed github/gh-aw --strict --shellcheck --actionlint — passed.
  • PATH="/opt/homebrew/bin:$PATH" make agent-report-progress — passed, including impacted tests and workflow drift checks.
  • Single read-only security review of authored source, generated production lock and fixture tests: PASS; no confirmed vulnerabilities.
  • Offline zizmor baseline/current comparison: unchanged ten Low self-repository advisories, no new findings.

Dry-run compilation is unavailable because the compiler rejects host steps/pre-agent steps and the workflow's existing custom Serena MCP server. No workflow was dispatched or rerun; no live success claim is made.

Security-relevant source changes

Source Before → after Security impact
Workflow preparation and shell grant Agent sizing pipeline → filesystem-only preparation and fixed JSON read. Removes the problematic execution grant without broadening shell access or adding network recipients.
Metrics consumption and completion Agent shell discovery and chat-only healthy status → prepared metrics and explicit safe-output completion. Preserves the 800-line threshold, fail-closed behavior, existing sandbox and issue limit.

Replace permission-sensitive agent discovery pipelines with a deterministic filesystem-only preparation step and a scoped metrics read. Require noop completion for healthy files and cover size thresholds, nested files, symlinks and missing tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 22, 2026 15:29
Copilot AI max review requested due to automatic review settings October 22, 2026 15:29
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

Generated from Test Quality Sentinel · sonnet50 · 12 AIC · ⌖ 15.1 AIC · ◇ 4.47 AIC · ⊞ 12.7K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

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.

Generated from Design Decision Gate 🏗️ · opus55 · 10.3 AIC · ⌖ 31.9 AIC · ◇ 16.1 AIC · ⊞ 1.9K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #71161

@github-actions github-actions Bot 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.

L91: delete: duplicated healthy_threshold packet field. Keep the existing step-2 800-line threshold as the sole source of truth.

net: -3 lines possible.

Generated by ✂️ Ponytail Reviewer for #71161 · codex · gpt56 · 9.81 AIC · ⌖ 5.43 AIC · ⊞ 14.8K
Comment /ponytail to run again

fs.mkdirSync(path.dirname(outputPath), { recursive: true });
fs.writeFileSync(outputPath, JSON.stringify({
healthy_threshold: 800,
source_file_count: files.length,

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.

L91: delete: duplicated healthy_threshold packet field. Keep the existing step-2 800-line threshold as the sole source of truth.

@github-actions github-actions Bot 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.

Review summary

No actionable blocking issues found in the changed lines. The prepared metrics packet is fail-closed, deterministic, and the regression coverage exercises threshold, recursion, ties, exclusions, symlinks, missing tests, and missing source directories. Static review only; tests were not run.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · 1.88 AIC · ⌖ 0.543 AIC · ⊞ 1.6K
Comment /review to run again

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.

🔵 Needs a closer look

The production preparation path has unresolved correctness and filesystem-boundary issues requiring correction and human validation.

2 open issues
What changed in this PR

Updates Daily File Diet, gh-aw’s Go-file size monitoring workflow, to avoid agent-side shell discovery failures.

Changes:

  • Precomputes deterministic source-file and paired-test line counts.
  • Replaces shell discovery with a fixed metrics read and requires explicit safe-output completion.
  • Adds regression fixtures and regenerates the executable workflow while retaining existing access limits.
File Description
actions/​setup/​js/​workflow_tool_policy_alignment.test.cjs Tests metrics preparation, edge cases, and tool permissions.
.github/​workflows/​daily-file-diet.md Adds metrics preparation and packet-based analysis instructions.
.github/​workflows/​daily-file-diet.lock.yml Regenerates preparation steps and shell grants.

Review effort: Max

sandbox:
agent:
id: awf
steps:
}
}
}
scan("pkg");
@pelikhan
pelikhan merged commit f3a9012 into main Oct 22, 2026
82 of 86 checks passed
@pelikhan
pelikhan deleted the pelikhan-sturdy-funicular branch October 22, 2026 15:45
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.93.1

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.

2 participants