Skip to content

docs: regen inventory blocks - #159

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
docs/auto-regen-inventory
Closed

docs: regen inventory blocks#159
github-actions[bot] wants to merge 1 commit into
mainfrom
docs/auto-regen-inventory

Conversation

@github-actions

@github-actions github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Auto-generated inventory update

Triggered by a push to main that touched a source of truth
for the inventory blocks in memory/glossary.md and
memory/projects/golfhelm.md.

What changed: the auto-regenerated sections between
<!-- AUTOGEN:* --> markers. Hand-curated narrative outside
those markers is preserved.

What to do: review the diff. If it looks sane, squash-merge.
If something looks wrong, the script lives at
scripts/regen-docs.mjs.

See .github/workflows/docs-regen.yml and the
"Auto-regen inventory docs" section of CLAUDE.md.

🤖 Generated by GitHub Actions

Greptile Summary

This PR contains auto-regenerated inventory blocks in memory/glossary.md and memory/projects/golfhelm.md, triggered by source-of-truth changes on main. All count deltas are arithmetically consistent with the items added in the diff.

  • memory/glossary.md: table count bumped 180 → 181; golf_recruit_documents added to the alphabetical table list.
  • memory/projects/golfhelm.md: route count 144 → 145 (/golf/dashboard/courses added); action-file count 112 → 115 (course-library.ts, recruit-documents-categories.ts, recruit-documents.ts added); hook count 51 → 52 (use-distance-units.ts added).

Confidence Score: 5/5

Purely additive documentation update; no logic, schema, or runtime code is touched.

All four inventory sections (tables, routes, actions, hooks) show consistent arithmetic between the declared count and the number of lines actually added. The new entries are inserted at correct alphabetical positions. No hand-curated narrative is altered.

No files require special attention.

Important Files Changed

Filename Overview
memory/glossary.md Auto-generated table section: count incremented 180 → 181, golf_recruit_documents inserted in correct alphabetical position.
memory/projects/golfhelm.md Auto-generated routes/actions/hooks sections updated; all three count deltas (+1, +3, +1) match the items listed in the diff.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Push to main touches source files] --> B[docs-regen.yml workflow triggered]
    B --> C[scripts/regen-docs.mjs runs]
    C --> D1[Scans src/lib/types/database.ts for tables/views/functions]
    C --> D2[Scans src/app/**/page.tsx for routes]
    C --> D3[Scans src/app/**/actions/**/*.ts for server-action files]
    C --> D4[Scans src/hooks/**/*.ts for custom hooks]
    D1 --> E1[Rewrites AUTOGEN:tables block in memory/glossary.md]
    D2 --> E2[Rewrites AUTOGEN:routes block]
    D3 --> E3[Rewrites AUTOGEN:actions block]
    D4 --> E4[Rewrites AUTOGEN:hooks block]
    E1 & E2 & E3 & E4 --> F[Bot opens PR #159 for human review]
Loading

Reviews (46): Last reviewed commit: "docs: regen inventory blocks" | Re-trigger Greptile

@github-actions
github-actions Bot force-pushed the docs/auto-regen-inventory branch from bb04bb5 to 58edd41 Compare May 28, 2026 19:43
@github-actions github-actions Bot added docs Documentation automated labels May 28, 2026
@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
helmv3 Ready Ready Preview, Comment Jun 14, 2026 11:42pm

Request Review

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@github-actions
github-actions Bot force-pushed the docs/auto-regen-inventory branch 2 times, most recently from 66d4884 to 3e19a04 Compare May 28, 2026 19:54
@github-actions
github-actions Bot force-pushed the docs/auto-regen-inventory branch from 3e19a04 to 92f02cf Compare May 28, 2026 20:44
@github-actions
github-actions Bot force-pushed the docs/auto-regen-inventory branch from 92f02cf to 4a9e4d1 Compare May 28, 2026 21:28
@github-actions
github-actions Bot force-pushed the docs/auto-regen-inventory branch 2 times, most recently from 265e70b to c81f6cf Compare May 28, 2026 21:50
@github-actions
github-actions Bot force-pushed the docs/auto-regen-inventory branch from c81f6cf to 71bff4b Compare May 28, 2026 22:07
@github-actions
github-actions Bot force-pushed the docs/auto-regen-inventory branch 5 times, most recently from bbeb0b7 to 0bc3998 Compare May 29, 2026 00:11
@github-actions
github-actions Bot force-pushed the docs/auto-regen-inventory branch 4 times, most recently from 074b41e to fc40e6a Compare June 2, 2026 10:37
@github-actions
github-actions Bot force-pushed the docs/auto-regen-inventory branch from fc40e6a to bb8494d Compare June 2, 2026 11:47
@github-actions
github-actions Bot force-pushed the docs/auto-regen-inventory branch from d397204 to ee62dfc Compare June 7, 2026 18:47

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 new potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment thread memory/glossary.md Outdated
</details>

<details><summary>Database functions (96)</summary>
<details><summary>Database functions (104)</summary>

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.

🟡 Auto-generated function list silently drops sg_expected_strokes due to regex not handling union-typed overloads

The function sg_expected_strokes exists in src/lib/types/database.ts:11651 but is missing from the auto-generated function list in memory/glossary.md. The regen script (scripts/regen-docs.mjs:98) uses the regex /^ ([a-z_][a-z0-9_]*):\s*[\{\(]/gm which requires { or ( immediately after the colon. However, sg_expected_strokes has a union-type definition (| { Args: ... } | { Args: ... }) that starts with | instead of {, so the regex silently skips it. The documented count says 104 functions when the actual count is 105. This function is heavily used in the codebase for strokes-gained calculations, so its omission from the glossary could mislead developers consulting the inventory.

Prompt for agents
The root cause is in scripts/regen-docs.mjs line 98. The regex /^      ([a-z_][a-z0-9_]*):\s*[\{\(]/gm only matches function keys whose type definition starts with { or ( on the same or next line. When database.ts has a function with overloaded signatures using TypeScript union syntax (e.g. sg_expected_strokes: | { ... } | { ... }), the | character doesn't match [{(] so the function is silently dropped.

Fix the regex in extractTopLevelKeys() to also match the union pattern. For example, change [\{\(] to [\{\(|] (add pipe), or use a broader approach like /^      ([a-z_][a-z0-9_]*):/gm and filter out false positives (like nested Args/Returns keys) by checking indentation level. The broader regex already produces the correct count of 105 when tested. After fixing the script, re-run npm run docs:regen to update the glossary.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 new potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment thread memory/glossary.md

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.

🚩 Enum inventory also suffers from the same multi-line union type regex limitation

The extractEnums regex in scripts/regen-docs.mjs:120 has the same class of limitation as the functions regex. Enums like baseball_pipeline_stage, coach_status, crm_event_type, email_status, golf_expense_category, golf_expense_paid_by, notification_type, program_type, and team_member_status all use multi-line union syntax in src/lib/types/database.ts:11739-11797 and are not captured. The glossary lists only 7 enums but database.ts contains 16. This is a pre-existing issue (unchanged by this PR) but worth noting since the same fix applied to the functions regex should also be applied to the enums regex.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread memory/glossary.md Outdated
</details>

<details><summary>Database functions (96)</summary>
<details><summary>Database functions (104)</summary>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 sg_expected_strokes() silently dropped despite still existing in database.ts

sg_expected_strokes still appears in src/lib/types/database.ts (line 11215) and is actively called by src/lib/golf/strokes-gained.ts and src/lib/coachhelm/v2/shot-analysis/shot-level-sg.ts — both files carry a comment saying it "MUST stay in lockstep with the DB function". It was removed from the inventory because regen-docs.mjs's extractTopLevelKeys regex (/^ ([a-z_][a-z0-9_]*):\s*[\{\(]/gm) requires the value to start with { or ( on the same logical line, but sg_expected_strokes now uses a union overload type (| { ... } | { ... }) so the first non-whitespace character after the : is |, not {. Any AI review or developer lookup against this inventory will incorrectly conclude the function no longer exists. The fix belongs in scripts/regen-docs.mjs — expand the regex (or the block-extraction logic) to also match :\s*\| union-type entries before this PR lands.

Fix in Claude Code

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 new potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

- `/baseball/reset-password`
- `/baseball/signup`
- `/baseball/team/[id]`
- `/fairway-preview`

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.

🚩 New routes include a top-level /fairway-preview outside the golf namespace

Among the 3 new routes, /fairway-preview (src/app/fairway-preview/page.tsx) sits at the top level outside both /golf/ and /baseball/ namespaces. This is unusual given the project's convention of namespacing all product routes under their sport prefix. It may be intentional (e.g., a public preview/marketing page), but worth confirming it doesn't need auth protection or sport-prefixed routing per the project conventions in CLAUDE.md.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@github-actions
github-actions Bot force-pushed the docs/auto-regen-inventory branch from c864450 to 957b15f Compare June 11, 2026 00:54

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 new potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment thread memory/glossary.md

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.

🚩 The sg_expected_strokes format change was caused by supabase gen types adding a function overload

At commit 49694b2 (when the script was first run), sg_expected_strokes in database.ts used a simple object format (sg_expected_strokes: { Args: ...; Returns: ... }) that the script's regex matched. A subsequent supabase gen types regeneration added a second overload signature, changing the format to a TypeScript union type (sg_expected_strokes: | { ... } | { ... }). This is the first time the regen script has been run since that schema change, exposing the regex limitation. Any future function that gains overloads will also be silently dropped.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Auto-generated by .github/workflows/docs-regen.yml.
Sources: src/lib/types/database.ts, src/app/**/page.tsx,
src/app/**/actions/**/*.ts, src/hooks/**/*.ts.
@njrini99-code

Copy link
Copy Markdown
Owner

Folded into #304 (feat/coachhelm-stats-roundup) — merged clean, combined gates green. Branch intact + reopenable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant