Skip to content

32 create a build process for the GitHub scripts#33

Merged
kenjudy merged 5 commits into
mainfrom
32-create-a-build-process-for-the-github-scripts
Apr 7, 2026
Merged

32 create a build process for the GitHub scripts#33
kenjudy merged 5 commits into
mainfrom
32-create-a-build-process-for-the-github-scripts

Conversation

@kenjudy

@kenjudy kenjudy commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

kenjudy and others added 5 commits April 7, 2026 10:12
Metric renamed from "Additions/Deletions Ratio" to "Net Additions Ratio"
following the formula change from additions/max(deletions,1) to the
bounded (additions-deletions)/(additions+deletions) formula.

Updated:
- Key Metrics table: new name and <0.50 target (was <3.0)
- Healthy/Warning/Critical thresholds: 0.33 / 0.33-0.50 / >0.50
- Note: AI_RISK_ADDITIONS_RATIO: 3 is unchanged — that is the Claude
  pre-filter multiplier, not the net additions ratio threshold

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uide

Previous instructions said "Copy .github/workflows/*.yml from this repo"
with no actual command. Added:
- curl commands to fetch workflow files directly from GitHub
- gh label create commands for 'metrics' and 'automated' labels required
  by the weekly issue-creation step (silent failure without these)
- Explicit Settings path for disabling auto-delete of head branches
- Explicit Settings path for read/write workflow permissions
- gh workflow run + gh run watch for first-run verification
- Note that pr-metrics.yml triggers automatically on PRs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…modules

Replaces all inline JavaScript helper functions in both GitHub Actions
workflows with direct require() calls to lib/config.js, lib/statistics.js,
and lib/metrics.js. actions/github-script@v7 runs Node.js with require()
resolving from $GITHUB_WORKSPACE after checkout — no build step needed.

Changes:
- lib/metrics.js: add isTestFile() (moved from lib/git.js) so workflows
  can require('./lib/metrics') without pulling in child_process dependencies
- lib/git.js: import isTestFile from lib/metrics.js, remove local definition
- code-metrics.yml: remove 5 inline helper functions, add 3 require() calls,
  replace hardcoded thresholds with CONFIG.*, replace test file regex with
  isTestFile(), add missing velocity_commits_per_day to summary output,
  fix classifyDoraArchetype() to use object signature matching lib/metrics.js
- pr-metrics.yml: remove 2 inline helper functions, add 2 require() calls,
  replace 4x test file regex with isTestFile(), replace hardcoded thresholds
  with CONFIG.*, fix classifyDoraArchetype() object signature
- CLAUDE.md: update architecture section (shared lib/ documented), remove
  "update both places" warning, note single source of truth for thresholds

Adjusting lib/config.js now propagates automatically to all three components.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Workflows require('./lib/config'), require('./lib/statistics'), and
require('./lib/metrics') at runtime after checkout. Without these three
files, the workflows fail with module-not-found errors. Quick Start now
fetches all five files and notes why lib/ must be committed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codifies the lesson from the refactor cycle: a green run does not prove
new code ran. Agents must download the artifact and verify expected fields
are present, and confirm the run commit SHA matches branch HEAD.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kenjudy kenjudy linked an issue Apr 7, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown

PR Analysis

Size: large (based on production code)
Production Code: 256 lines (8 files)
Test Code: 14 lines (1 files)
Total: 270 lines (9 files)
Test-to-Production Ratio: 0.05:1

Concerns

  • Large production changes - review carefully
  • Median net additions ratio 0.64 exceeds 0.50 - possible batch-acceptance pattern

Strengths

  • Incremental development pattern detected
  • Includes refactoring or cleanup work
  • Message quality 100% meets discipline threshold

Commit Analysis

Total Commits: 5
Average Commit Size: 52 production lines
Average Files per Commit: 2.2

Metric Value
Large commits (>100 prod lines) 1/5 (20%)
Sprawling commits (>5 files) 1/5 (20%)
Test-first discipline 1/5 (20%)
Message quality 5/5 (100%)
Median net additions ratio 0.64
Test-only commits 0
Production-only commits 4

Commit Details

7dbce67 Ken Judy (4/7/2026)
docs: update README for net additions ratio rename and new thresholds
8 prod lines, 1 files

200fc84 Ken Judy (4/7/2026)
docs: replace vague Quick Start with actionable 5-step installation guide
33 prod lines, 1 files

bc777bb Ken Judy (4/7/2026)
refactor: eliminate workflow logic duplication via require() of lib/ modules
190 prod lines, 7 files [large, sprawling, test+prod]

8c9ed9a Ken Judy (4/7/2026)
docs: add lib/ curl commands to Quick Start install instructions
12 prod lines, 1 files

350a872 Ken Judy (4/7/2026)
docs: add workflow smoke test quality gate to AGENTS.md
15 prod lines, 1 files

Test Coverage

Test Adequacy: needs-improvement

  • Low test coverage ratio - consider adding more tests

Target ratio: 0.5-2.0 test lines per production line

DORA Capability Assessment

Archetype: mixed-signals
No clear archetype pattern. Review individual metric thresholds.

Capability Metric Value Target
Small Batches Large commit % 20% <20%
Small Batches Sprawling commit % 20% <10%
Version Control Test-first discipline 20% >50%
Version Control Message quality 100% >60%
AI Risk Signal Net additions ratio (median) 0.64 <0.50
Automated by Code Metrics Workflow

@kenjudy
kenjudy merged commit 8deb6db into main Apr 7, 2026
1 check passed
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.

Create a build process for the github scripts

1 participant